Fix file sharing: add backend routes for /orgs/files/{fileId}/share, update frontend ShareFileDialog to use correct paths and improve UI

This commit is contained in:
Leon Bösche
2026-01-24 22:47:27 +01:00
parent 228a5c9644
commit c7aab0b026
3 changed files with 48 additions and 9 deletions

View File

@@ -221,6 +221,17 @@ func NewRouter(cfg *config.Config, db *database.DB, jwtManager *jwt.Manager, aut
revokeUserFileShareLinkHandler(w, req, db)
})
// Share link management for personal files (alternative path for frontend compatibility)
r.Get("/orgs/files/{fileId}/share", func(w http.ResponseWriter, req *http.Request) {
getUserFileShareLinkHandler(w, req, db)
})
r.Post("/orgs/files/{fileId}/share", func(w http.ResponseWriter, req *http.Request) {
createUserFileShareLinkHandler(w, req, db)
})
r.Delete("/orgs/files/{fileId}/share", func(w http.ResponseWriter, req *http.Request) {
revokeUserFileShareLinkHandler(w, req, db)
})
// Org routes
r.Get("/orgs", func(w http.ResponseWriter, req *http.Request) {
listOrgsHandler(w, req, db)