Fixed incorrect subscriber SQL fetch check

This commit is contained in:
Kailash Nadh 2018-10-26 14:35:17 +05:30
parent 229fd7f0c1
commit 0a86ae761b

View file

@ -57,7 +57,7 @@ func handleGetSubscriber(c echo.Context) error {
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError,
fmt.Sprintf("Error fetching subscriber: %s", pqErrMsg(err)))
} else if err == sql.ErrNoRows {
} else if len(out) == 0 {
return echo.NewHTTPError(http.StatusBadRequest, "Subscriber not found.")
}
out.LoadLists(app.Queries.GetSubscriberLists)