Moving the domain models to a models package in expenses

This commit is contained in:
2025-08-07 18:02:28 +01:00
parent 86db133640
commit f0ca0051b6
15 changed files with 213 additions and 181 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package pages
import (
"database/sql"
"expenses/expenses"
experr "expenses/expenses/errors"
"fmt"
"net/http"
@@ -90,7 +91,7 @@ func deleteType(c *gin.Context) {
TypeID: typeID,
}
err = typ.Delete()
if err == expenses.ErrNotFound {
if err == experr.ErrNotFound {
errMsg := fmt.Sprintf("category %d not found", typeID)
c.String(http.StatusNotFound, errMsg)
return