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

Respond with status code 204 for DELETE request methods

parent d5eca728
No related branches found
No related tags found
No related merge requests found
...@@ -258,7 +258,12 @@ func (api Api) Handler(baseCtx context.Context, apiGatewayProxyReq events.APIGat ...@@ -258,7 +258,12 @@ func (api Api) Handler(baseCtx context.Context, apiGatewayProxyReq events.APIGat
//handler succeeded, some handler does not have a response data (typically post/put/patch/delete) //handler succeeded, some handler does not have a response data (typically post/put/patch/delete)
err = nil err = nil
switch apiGatewayProxyReq.HTTPMethod {
case http.MethodDelete:
res.StatusCode = http.StatusNoContent
default:
res.StatusCode = http.StatusOK res.StatusCode = http.StatusOK
}
if len(results) > 1 { if len(results) > 1 {
responseStruct := results[0].Interface() responseStruct := results[0].Interface()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment