Commit 9525ac0
committed
fix(files): revert broken ref opt, clean 409 on restore, null parentId on orphaned restore
- files.tsx: revert the activeDropTargetId ref optimization — the ref doesn't
trigger re-renders so the drop-target highlight never updated during drag;
activeDropTargetId is back in state and in the rowDragDropConfig deps
- restore/route.ts: catch Postgres 23505 unique-constraint violation and
return a clean 409 instead of leaking the raw error as 400
- restoreWorkspaceFileFolder: check if the parent folder is still archived
before restoring; if it is, restore to root (parentId: null) so the folder
is never orphaned under an archived parent1 parent 13c4f18 commit 9525ac0
3 files changed
Lines changed: 29 additions & 14 deletions
File tree
- apps/sim
- app
- api/workspaces/[id]/files/folders/[folderId]/restore
- workspace/[workspaceId]/files
- lib/uploads/contexts/workspace
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
| |||
683 | 679 | | |
684 | 680 | | |
685 | 681 | | |
686 | | - | |
| 682 | + | |
687 | 683 | | |
688 | 684 | | |
689 | 685 | | |
| |||
817 | 813 | | |
818 | 814 | | |
819 | 815 | | |
| 816 | + | |
820 | 817 | | |
821 | 818 | | |
822 | 819 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
917 | 935 | | |
918 | 936 | | |
919 | | - | |
| 937 | + | |
920 | 938 | | |
921 | 939 | | |
922 | 940 | | |
| |||
0 commit comments