From 7fc81daaa0748c4ee6cb34e2c9fbeb8de92f5324 Mon Sep 17 00:00:00 2001 From: drjones Date: Thu, 23 Jul 2026 03:55:10 -0700 Subject: [PATCH] Fix six buttons sending GET instead of POST, causing 404s The api() helper only sends POST when a body argument is passed; Browse Folder, Pause, Stop, Retry Failed (x2), Undo All, and Scan for Duplicates were all called with no body, so they defaulted to GET against POST-only server routes and 404'd. Verified live via the actual browser: Pause/Stop now correctly transition server status (running -> paused -> idle) instead of silently failing. Co-Authored-By: Claude Sonnet 5 --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 4af3abd..93b30b9 100644 --- a/index.html +++ b/index.html @@ -1012,7 +1012,7 @@ if($("btnBrowseFolder")){ $("btnBrowseFolder").onclick = async ()=>{ $("btnBrowseFolder").disabled = true; showToast("Opening folder chooser…", "info"); - const j = await api("/api/choose_folder"); + const j = await api("/api/choose_folder", {}); $("btnBrowseFolder").disabled = false; if(j.ok && j.folder){ $("folder").value = j.folder; @@ -1052,18 +1052,18 @@ $("btnStart").onclick = ()=>{ }); }; -$("btnPause").onclick = ()=>api("/api/pause"); -$("btnStop").onclick = ()=>api("/api/stop"); +$("btnPause").onclick = ()=>api("/api/pause", {}); +$("btnStop").onclick = ()=>api("/api/stop", {}); $("btnRetryFailed").onclick = async ()=>{ - const j = await api("/api/retry_failed"); + const j = await api("/api/retry_failed", {}); if(j.ok) addLog({level:"info",msg:"Retrying failures...",ts:new Date().toTimeString().slice(0,8)}); }; $("btnUndoAll").onclick = async ()=>{ if(confirm("☣ WARNING ☣\nThis will remove all PHOTON embedded descriptions/categories/keywords from ALL files in the scanned folder. It will also clear organized symlinks, reset the database and delete the failures log.\n\nTHIS ACTION CANNOT BE UNDONE.\n\nDo you want to proceed?")){ $("btnUndoAll").disabled = true; - const j = await api("/api/undo_all"); + const j = await api("/api/undo_all", {}); $("btnUndoAll").disabled = false; if(j.ok){ recentFiles = []; @@ -1753,7 +1753,7 @@ async function loadFailed(){ } $("btnRetryAllFailed").onclick = async ()=>{ $("btnRetryAllFailed").disabled = true; - const j = await api("/api/retry_failed"); + const j = await api("/api/retry_failed", {}); if(j.ok) addLog({level:"info", msg:"Retrying all failed photos…", ts:new Date().toTimeString().slice(0,8)}); }; @@ -1904,7 +1904,7 @@ async function loadDupeGroups(){ }); } $("btnScanDupes").onclick = async ()=>{ - const j = await api("/api/dedupe/build"); + const j = await api("/api/dedupe/build", {}); if(j.ok){ addLog({level:"info", msg:"Duplicate scan started in the background…", ts:new Date().toTimeString().slice(0,8)}); loadDupeGroups();