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 node creation from ressources controller: Accessibility cannot be null in database -> set default 1

Smaug6739037e9f8b2160
diff --git a/.gitattributes b/.gitattributes
index 059c1b20..22489295 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -18,4 +18,6 @@ frontend/app/styles/katex/**/* linguist-vendored
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
-*.json text eol=lf
\ No newline at end of file
+*.json text eol=lf
+*.html text eol=lf
+* text eol=lf
\ No newline at end of file
diff --git a/backend/controllers/ressources.controller.go b/backend/controllers/ressources.controller.go
index 6c33edda..ba87a19a 100644
--- a/backend/controllers/ressources.controller.go
+++ b/backend/controllers/ressources.controller.go
@@ -132,7 +132,8 @@ func (ctr *Controller) UploadFile(c *gin.Context) (int, any) {
UserId: userId,
ParentId: nil,
Name: fmt.Sprintf("%.*s", 50, header.Filename),
- Role: 4, // Ressource role is always 4
+ Role: 4, // Ressource role is always 4
+ Accessibility: utils.IntPtr(1), // Default
Size: &header.Size,
Content: &header.Filename,
ContentCompiled: &transformedPath,
diff --git a/backend/utils/utils.go b/backend/utils/utils.go
index 3d75c267..64716ad0 100644
--- a/backend/utils/utils.go
+++ b/backend/utils/utils.go
@@ -12,3 +12,7 @@ func IfNotNilValue[T any](newValue *T, defaultValue T) T {
}
return defaultValue
}
+
+func IntPtr(i int) *int {
+ return &i
+}