diff --git a/b0esche_cloud/lib/pages/home_page.dart b/b0esche_cloud/lib/pages/home_page.dart index 54b520d..cce718c 100644 --- a/b0esche_cloud/lib/pages/home_page.dart +++ b/b0esche_cloud/lib/pages/home_page.dart @@ -140,7 +140,7 @@ class _HomePageState extends State with TickerProviderStateMixin { onPressed: () { final name = controller.text.trim(); if (name.isNotEmpty) { - context.read().add( + BlocProvider.of(context).add( CreateOrganization(name), ); Navigator.of(context).pop(); diff --git a/go_cloud/internal/database/db.go b/go_cloud/internal/database/db.go index 1b2ad11..cd601da 100644 --- a/go_cloud/internal/database/db.go +++ b/go_cloud/internal/database/db.go @@ -277,7 +277,7 @@ func (db *DB) GetOrgFiles(ctx context.Context, orgID uuid.UUID, path string, q s OR ($2 != '/' AND path LIKE $2 || '/%' AND path NOT LIKE $2 || '/%/%') ) AND ($3 = '' OR name ILIKE '%' || $3 || '%') - ORDER BY name + ORDER BY CASE WHEN type = 'folder' THEN 0 ELSE 1 END, name LIMIT $4 OFFSET $5 `, orgID, path, q, pageSize, offset) if err != nil { @@ -327,7 +327,7 @@ func (db *DB) GetUserFiles(ctx context.Context, userID uuid.UUID, path string, q OR ($2 != '/' AND path LIKE $2 || '/%' AND path NOT LIKE $2 || '/%/%') ) AND ($3 = '' OR name ILIKE '%' || $3 || '%') - ORDER BY name + ORDER BY CASE WHEN type = 'folder' THEN 0 ELSE 1 END, name LIMIT $4 OFFSET $5 `, userID, path, q, pageSize, offset) if err != nil {