Fix folder sorting and organization creation provider issue

This commit is contained in:
Leon Bösche
2026-01-10 19:06:18 +01:00
parent 0f13b6c01d
commit 54fa429e3e
2 changed files with 3 additions and 3 deletions

View File

@@ -140,7 +140,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
onPressed: () {
final name = controller.text.trim();
if (name.isNotEmpty) {
context.read<OrganizationBloc>().add(
BlocProvider.of<OrganizationBloc>(context).add(
CreateOrganization(name),
);
Navigator.of(context).pop();

View File

@@ -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 {