Fixed "answered" API error

This commit is contained in:
Daniel J. Summers
2018-05-27 18:00:37 -05:00
parent 79ced40470
commit 9de713fc6a
3 changed files with 15 additions and 10 deletions

View File

@@ -156,9 +156,6 @@ func Answered(userID string) []JournalRequest {
AND "lastStatus" = 'Answered'
ORDER BY "asOf" DESC`,
userID)
if err == sql.ErrNoRows {
return make([]JournalRequest, 0)
}
if err != nil {
log.Print(err)
return nil
@@ -177,6 +174,9 @@ func ByID(userID, reqID string) (*JournalRequest, bool) {
&req.RequestID, &req.Text, &req.AsOf, &req.LastStatus,
)
if err != nil {
if err == sql.ErrNoRows {
return nil, true
}
log.Print(err)
return nil, false
}