[object Object]

← back to Dw Hero Admin

fix saveBtn dead-code r.ok check; add backup-file patterns to .gitignore

b35f88cbbe1ce4e8f05111e5949541310b1ba983 · 2026-05-30 23:53:26 -0700 · SteveStudio2

api() resolves to the JSON body not the Response object, so the else branch
on r.ok was unreachable (HTTP errors already throw). Simplified to always
flash success in .then(). Also added *.bak / *.orig / *.old etc. patterns
to .gitignore to prevent accidental backup-file commits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files touched

Diff

commit b35f88cbbe1ce4e8f05111e5949541310b1ba983
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Sat May 30 23:53:26 2026 -0700

    fix saveBtn dead-code r.ok check; add backup-file patterns to .gitignore
    
    api() resolves to the JSON body not the Response object, so the else branch
    on r.ok was unreachable (HTTP errors already throw). Simplified to always
    flash success in .then(). Also added *.bak / *.orig / *.old etc. patterns
    to .gitignore to prevent accidental backup-file commits.
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 .gitignore        | 8 ++++++++
 public/index.html | 5 ++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 1924158..dfa7731 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,11 @@ tmp/
 dist/
 build/
 .next/
+*.bak
+*.bak-*
+*.pre-*
+*.orig
+*.old
+*.save
+*~
+copy-of-*
diff --git a/public/index.html b/public/index.html
index 3a75cf3..a4ef5cd 100644
--- a/public/index.html
+++ b/public/index.html
@@ -515,9 +515,8 @@
       method: 'POST',
       headers: { 'content-type': 'application/json' },
       body: JSON.stringify(state.grid),
-    }).then(function (r) {
-      if (r.ok) flashStatus('✓ saved + pushed to prod', 'ok');
-      else flashStatus('✗ ' + (r.error || 'unknown'), 'err');
+    }).then(function () {
+      flashStatus('✓ saved + pushed to prod', 'ok');
     }).catch(function (e) { flashStatus('✗ ' + e.message, 'err'); });
   });
 

← a1841b6 dw-hero-admin: schema-validate /api/site/:site/grid POST (Ti  ·  back to Dw Hero Admin  ·  Add per-site favicon (kills /favicon.ico 404) 7d6c126 →