fix(web): surface a toast on failed mutations (#14)

Several client mutations either ignored a non-ok response (silent no-op) or
toasted success unconditionally even when the request failed. Sweep them so every
mutation gives feedback:

- artists: toggle auto-monitor, unfollow → error toast on failure.
- discography + wanted: toggle monitor / search-now → success or error toast.
- discover suggestion follow/want/dismiss → error toast (was toasting success
  even on failure).
- The Floor: queue request + retry → error toast on failure.
- artist-modal + preview follow/want, Last.fm want → error toast on failure
  (closes the deferred "want() shows no toast on non-ok" item).

web 153 tests, tsc + build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan
2026-07-14 13:25:31 +02:00
parent bc42e546f0
commit 7e5c083cef
8 changed files with 41 additions and 16 deletions
+2
View File
@@ -174,6 +174,8 @@ export function LastfmClient() {
toast(`Wanted ${match.title}`);
setWantedSet((s) => new Set(s).add(match.rgMbid));
setAlbumTarget(null);
} else {
toast(`Couldn't add ${match.title}`);
}
}