feat(account): #66 remove db interface for accounts
This commit was merged in pull request #73.
This commit is contained in:
@@ -3,6 +3,7 @@ package handler
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"spend-sparrow/db"
|
||||
"spend-sparrow/service"
|
||||
"spend-sparrow/utils"
|
||||
"strings"
|
||||
@@ -15,6 +16,9 @@ func handleError(w http.ResponseWriter, r *http.Request, err error) {
|
||||
} else if errors.Is(err, service.ErrBadRequest) {
|
||||
utils.TriggerToastWithStatus(w, r, "error", extractErrorMessage(err), http.StatusBadRequest)
|
||||
return
|
||||
} else if errors.Is(err, db.ErrNotFound) {
|
||||
utils.TriggerToastWithStatus(w, r, "error", extractErrorMessage(err), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
utils.TriggerToastWithStatus(w, r, "error", "Internal Server Error", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user