Skip to content
Snippets Groups Projects
Commit d5176db3 authored by Francé Wilke's avatar Francé Wilke
Browse files

Add TimeResponse to api_responses

parent 614322aa
Branches
Tags v1.192.0
No related merge requests found
......@@ -3,6 +3,7 @@ package api_responses
import (
"encoding/json"
"fmt"
"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/date_utils"
"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/errors"
"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/map_utils"
"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/string_utils"
......@@ -291,3 +292,12 @@ func GenericJSONResponseWithMessage(code int, err error) events.APIGatewayProxyR
Headers: map_utils.MergeMaps(utils.CorsHeaders(), ContentTypeJSONHeader),
}
}
func TimeResponse() events.APIGatewayProxyResponse {
currentTime, _ := json.Marshal(date_utils.CurrentDate())
return events.APIGatewayProxyResponse{
StatusCode: http.StatusOK,
Body: string(currentTime),
Headers: map_utils.MergeMaps(utils.CorsHeaders(), ContentTypeJSONHeader),
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment