feat(account): #66 remove db interface for accounts
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m56s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m33s

This commit was merged in pull request #73.
This commit is contained in:
2025-05-16 11:37:46 +02:00
parent dbf272e3f3
commit 7e244ccc07
6 changed files with 46 additions and 176 deletions

View File

@@ -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)