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 comments & types

Smaug#6739d9597c582af5
diff --git a/backend/controllers/categories.controller.go b/backend/controllers/categories.controller.go
index 3a74b322..5c5e7580 100644
--- a/backend/controllers/categories.controller.go
+++ b/backend/controllers/categories.controller.go
@@ -18,12 +18,12 @@ func NewCategoriesController(app *app.App) CategoriesController {
}
}
-// Get documents
-// @Summary Get all documents
+// Get categories
+// @Summary Get all categories
// @Method GET
-// @Router /documents [get]
+// @Router /categories [get]
// @Security Authenfification: Auth
-// @Success 200 {object} Success([]models.Document)
+// @Success 200 {object} Success([]models.Category)
// @Failure 400 {object} Error
// @Failure 401 {object} Error
func (ctr *Controller) GetCategories(c *gin.Context) (int, any) {
@@ -31,9 +31,9 @@ func (ctr *Controller) GetCategories(c *gin.Context) (int, any) {
if err != nil {
return http.StatusUnauthorized, err
}
- documents, err := ctr.app.Services.Document.GetAllDocuments(id)
+ categories, err := ctr.app.Services.Category.GetAllCategories(id)
if err != nil {
return http.StatusInternalServerError, err
}
- return http.StatusOK, documents
+ return http.StatusOK, categories
}