in handlers/apigateway.go [76:88]
func (l *APIGatewayV2Handler) DeleteHandler(ctx context.Context, event events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error) {
id, ok := event.PathParameters["id"]
if !ok {
return errResponse(http.StatusBadRequest, "missing 'id' parameter in path"), nil
}
err := l.products.DeleteProduct(ctx, id)
if err != nil {
return errResponse(http.StatusInternalServerError, err.Error()), nil
}
return response(http.StatusOK, nil), nil
}