Fix folder sorting and organization creation provider issue
This commit is contained in:
@@ -140,7 +140,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
final name = controller.text.trim();
|
final name = controller.text.trim();
|
||||||
if (name.isNotEmpty) {
|
if (name.isNotEmpty) {
|
||||||
context.read<OrganizationBloc>().add(
|
BlocProvider.of<OrganizationBloc>(context).add(
|
||||||
CreateOrganization(name),
|
CreateOrganization(name),
|
||||||
);
|
);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
|||||||
@@ -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 || '/%/%')
|
OR ($2 != '/' AND path LIKE $2 || '/%' AND path NOT LIKE $2 || '/%/%')
|
||||||
)
|
)
|
||||||
AND ($3 = '' OR name ILIKE '%' || $3 || '%')
|
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
|
LIMIT $4 OFFSET $5
|
||||||
`, orgID, path, q, pageSize, offset)
|
`, orgID, path, q, pageSize, offset)
|
||||||
if err != nil {
|
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 || '/%/%')
|
OR ($2 != '/' AND path LIKE $2 || '/%' AND path NOT LIKE $2 || '/%/%')
|
||||||
)
|
)
|
||||||
AND ($3 = '' OR name ILIKE '%' || $3 || '%')
|
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
|
LIMIT $4 OFFSET $5
|
||||||
`, userID, path, q, pageSize, offset)
|
`, userID, path, q, pageSize, offset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user