diff --git a/b0esche_cloud/lib/widgets/share_file_dialog.dart b/b0esche_cloud/lib/widgets/share_file_dialog.dart index 3b4eb52..41b091c 100644 --- a/b0esche_cloud/lib/widgets/share_file_dialog.dart +++ b/b0esche_cloud/lib/widgets/share_file_dialog.dart @@ -40,8 +40,8 @@ class _ShareFileDialogState extends State { try { final apiClient = getIt(); - final path = widget.orgId == 'files' - ? '/user/files/${widget.fileId}/share' + final path = widget.orgId.isEmpty + ? '/orgs/files/${widget.fileId}/share' : '/orgs/${widget.orgId}/files/${widget.fileId}/share'; final response = await apiClient.getRaw(path); @@ -68,8 +68,8 @@ class _ShareFileDialogState extends State { try { final apiClient = getIt(); - final path = widget.orgId == 'files' - ? '/user/files/${widget.fileId}/share' + final path = widget.orgId.isEmpty + ? '/orgs/files/${widget.fileId}/share' : '/orgs/${widget.orgId}/files/${widget.fileId}/share'; final response = await apiClient.postRaw(path, data: {}); @@ -93,8 +93,8 @@ class _ShareFileDialogState extends State { try { final apiClient = getIt(); - final path = widget.orgId == 'files' - ? '/user/files/${widget.fileId}/share' + final path = widget.orgId.isEmpty + ? '/orgs/files/${widget.fileId}/share' : '/orgs/${widget.orgId}/files/${widget.fileId}/share'; await apiClient.delete(path); @@ -197,11 +197,39 @@ class _ShareFileDialogState extends State { Row( children: [ Expanded( - child: Text( - _shareUrl!, + child: TextField( + controller: TextEditingController(text: _shareUrl), + readOnly: true, maxLines: 2, - overflow: TextOverflow.ellipsis, style: TextStyle(color: AppTheme.primaryText), + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + color: AppTheme.secondaryText.withValues( + alpha: 0.3, + ), + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + color: AppTheme.secondaryText.withValues( + alpha: 0.3, + ), + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + color: AppTheme.accentColor, + ), + ), + contentPadding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + ), ), ), const SizedBox(width: 16), diff --git a/go_cloud/api b/go_cloud/api index 879a194..73cae8c 100755 Binary files a/go_cloud/api and b/go_cloud/api differ diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index 95c660e..58b51fe 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -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)