From 55944901e082e6fe24e81b73e306ceaae15bfb8d Mon Sep 17 00:00:00 2001 From: Shubham Kirve Date: Fri, 21 Apr 2023 14:40:00 +0530 Subject: [PATCH] Updating status code in filters response (#24) * TP-0000 | shifting readiness controller at top * TP-0000 | refactoring status code in resposne --- service/filter_service.go | 2 +- service/incident_service.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/filter_service.go b/service/filter_service.go index 9036c29..c157dbf 100644 --- a/service/filter_service.go +++ b/service/filter_service.go @@ -52,7 +52,7 @@ func (f *filterService) GetFilters(c *gin.Context) { filterResponses = append(filterResponses, *incidentStatusFilterData, *severityFilterData, *teamFilterData) - c.JSON(http.StatusBadRequest, common.SuccessResponse(filterResponses, http.StatusOK)) + c.JSON(http.StatusOK, common.SuccessResponse(filterResponses, http.StatusOK)) } func (f *filterService) GetEntityRepositories() ( diff --git a/service/incident_service.go b/service/incident_service.go index ff47f22..b195284 100644 --- a/service/incident_service.go +++ b/service/incident_service.go @@ -111,12 +111,12 @@ func (i *incidentService) GetIncidents(c *gin.Context) { TotalElements: totalElements, } - c.JSON(http.StatusMultiStatus, common.SuccessPaginatedResponse(incidentResponses, common.Page { + c.JSON(http.StatusOK, common.SuccessPaginatedResponse(incidentResponses, common.Page { PageSize: page.PageSize, TotalPages: int64(math.Ceil(float64(page.TotalElements) / float64(pageSize))), PageNumber: pageNumber, TotalElements: page.TotalElements, - }, http.StatusMultiStatus)) + }, http.StatusOK)) } func (i *incidentService) GetIncidentResponseFromIncidentEntity(