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.

Reponse style

Smaug67395051b844fc90
diff --git a/backend/utils/permissions.go b/backend/utils/permissions.go
index 642a71d6..2f6077b9 100644
--- a/backend/utils/permissions.go
+++ b/backend/utils/permissions.go
@@ -69,5 +69,5 @@ func SelfOrPermission(ctx *gin.Context, allowed int) (int64, error) {
if id_param != userId && CheckPermission(role.(int), allowed) {
return id_param, nil
}
- return 0, errors.New("unauthorized access")
+ return 0, errors.New("unauthorized")
}
diff --git a/backend/utils/responses.go b/backend/utils/responses.go
index 9e18c34c..afda9c15 100644
--- a/backend/utils/responses.go
+++ b/backend/utils/responses.go
@@ -17,6 +17,10 @@ func Success(data any) gin.H {
}
func Error(message string) gin.H {
+ // Capitalize the first letter of the error message
+ if len(message) > 0 {
+ message = strings.ToUpper(message[:1]) + message[1:]
+ }
return gin.H{
"status": "error",
"timestamp": time.Now().UnixMilli(),