Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix error message bad return type

Smaug6739d0dd88b5deac
diff --git a/backend/controllers/categories.controller.go b/backend/controllers/categories.controller.go
index cd27556c..40b71526 100644
--- a/backend/controllers/categories.controller.go
+++ b/backend/controllers/categories.controller.go
@@ -4,6 +4,7 @@ import (
"alexandrie/app"
"alexandrie/models"
"alexandrie/utils"
+ "errors"
"net/http"
"github.com/gin-gonic/gin"
@@ -54,7 +55,7 @@ func (ctr *Controller) GetCategories(c *gin.Context) (int, any) {
func (ctr *Controller) CreateCategory(c *gin.Context) (int, any) {
var category models.Category
if err := c.ShouldBind(&category); err != nil {
- return http.StatusBadRequest, utils.Error("Invalid request payload")
+ return http.StatusBadRequest, errors.New("invalid request payload")
}
userId, err := utils.GetUserIdCtx(c)