Fix incorrect campaign API response when there are no campaigns
This commit is contained in:
parent
6747a95b3d
commit
32a543bf4f
|
@ -90,8 +90,8 @@ func handleGetCampaigns(c echo.Context) error {
|
||||||
return echo.NewHTTPError(http.StatusBadRequest, "Campaign not found.")
|
return echo.NewHTTPError(http.StatusBadRequest, "Campaign not found.")
|
||||||
}
|
}
|
||||||
if len(out.Results) == 0 {
|
if len(out.Results) == 0 {
|
||||||
out.Results = make([]models.Campaign, 0)
|
out.Results = []models.Campaign{}
|
||||||
return c.JSON(http.StatusOK, out)
|
return c.JSON(http.StatusOK, okResp{out})
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(out.Results); i++ {
|
for i := 0; i < len(out.Results); i++ {
|
||||||
|
|
Loading…
Reference in New Issue