fix: curate swap endpoint name, reorder date field, 404 on missing asset

- Rename /curate/retag to /curate/swap; response now includes new_tag
- /curate/reorder: read body["order"] key (was ordered_ids); include date field
- /curate/remove and /curate/swap: return 404 if asset_id not found
- Update phase3.html JS fetch calls and reorder payload to match spec

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 16:37:25 +02:00
parent 851df070e4
commit 23b68d845b
2 changed files with 15 additions and 14 deletions
@@ -56,7 +56,7 @@ async function removeFn(albumId, assetId, el) {
}
async function retag(albumId, assetId, el) {
await fetch('/curate/retag', {
await fetch('/curate/swap', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({album_id: albumId, asset_id: assetId})
@@ -69,10 +69,11 @@ async function reorder(albumId, container) {
var ids = Array.from(container.querySelectorAll('.photo-card')).map(function(e) {
return e.dataset.assetId;
});
var day = container.id.replace('day-', '');
await fetch('/curate/reorder', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({album_id: albumId, ordered_ids: ids})
body: JSON.stringify({album_id: albumId, date: day, order: ids})
});
}