Skip to content

Commit

Permalink
Fix incorrect campaign API response when there are no campaigns
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Dec 6, 2019
1 parent 6747a95 commit 32a543b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions campaigns.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func handleGetCampaigns(c echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, "Campaign not found.")
}
if len(out.Results) == 0 {
out.Results = make([]models.Campaign, 0)
return c.JSON(http.StatusOK, out)
out.Results = []models.Campaign{}
return c.JSON(http.StatusOK, okResp{out})
}

for i := 0; i < len(out.Results); i++ {
Expand Down

0 comments on commit 32a543b

Please sign in to comment.