Skip to content

fix: admin review/flag buttons now update modal after actions#734

Merged
bokelley merged 2 commits into
mainfrom
bokelley/fix-admin-review-buttons
Jan 12, 2026
Merged

fix: admin review/flag buttons now update modal after actions#734
bokelley merged 2 commits into
mainfrom
bokelley/fix-admin-review-buttons

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Fix "Mark Reviewed", "Flag", and "Unflag" buttons in admin thread detail modal not updating UI after successful API calls
  • Add proper HTTP error handling with response.ok checks (fetch doesn't throw on non-2xx responses)
  • Refresh thread detail modal after operations by calling viewThread() to show updated state
  • Apply same fix pattern to approveItem and rejectItem for consistency
  • Use optional chaining and await for cleaner code

Test plan

  • All 187 tests passing
  • TypeScript compilation passes
  • Code review completed with suggestions addressed
  • Manual test: Open thread detail, click "Mark Reviewed", verify button disappears and "Reviewed by" badge appears
  • Manual test: Open flagged thread, click "Unflag", verify button changes to "Flag"

🤖 Generated with Claude Code

bokelley and others added 2 commits January 12, 2026 16:03
The "Mark Reviewed", "Flag", and "Unflag" buttons in the admin thread
detail modal weren't properly updating the UI after successful API calls.

Changes:
- Add response.ok checks to properly detect HTTP errors (fetch doesn't
  throw on non-2xx responses, only on network errors)
- Refresh the thread detail modal after successful operations by calling
  viewThread() to show the updated state (reviewed badge, flag status)
- Include error messages in alert dialogs for better debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The "Mark Reviewed", "Flag", and "Unflag" buttons in the admin thread
detail modal weren't properly updating the UI after successful API calls.

Changes:
- Add response.ok checks to properly detect HTTP errors (fetch doesn't
  throw on non-2xx responses, only on network errors)
- Refresh the thread detail modal after successful operations by calling
  viewThread() to show the updated state (reviewed badge, flag status)
- Include error messages in alert dialogs for better debugging
- Use optional chaining and await for viewThread calls
- Apply same error handling pattern to approveItem and rejectItem

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit c597cf8 into main Jan 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant