From 54fa429e3e0b62b1ef739899a72da4d64e33cb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Sat, 10 Jan 2026 19:06:18 +0100 Subject: [PATCH] Fix folder sorting and organization creation provider issue --- b0esche_cloud/lib/pages/home_page.dart | 2 +- go_cloud/internal/database/db.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 {