Commit c2373d6
Add checkout_objective RPC
Introduced a PostgreSQL function checkout_objective to atomically lock an objective. Replaced previous JS-based checkout with RPC call to set locked_by/locked_at when eligible, enabling safe first-time checkout and stale-lock recovery.
X-Lovable-Edit-ID: edt-04f69ba7-cbb8-4fd5-9a69-6fd0a72d9009
Co-authored-by: magnusfroste <38864257+magnusfroste@users.noreply.github.com>File tree
3 files changed
+29
-10
lines changed- src/integrations/supabase
- supabase
- migrations
3 files changed
+29
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2850 | 2850 | | |
2851 | 2851 | | |
2852 | 2852 | | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
2853 | 2857 | | |
2854 | 2858 | | |
2855 | 2859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
429 | 425 | | |
430 | | - | |
| 426 | + | |
431 | 427 | | |
432 | 428 | | |
433 | 429 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments