Commit graph

3 commits

Author SHA1 Message Date
Randall Stillwell
5dd7de86ad Add debug logging to promote-user endpoint
🐛 Debug:
- Log request body type and content
- Identify why JSON parsing is failing
- Temporary debug version to diagnose issue
2025-07-22 07:10:14 -05:00
Randall Stillwell
028c5396f3 Fix promote-user endpoint request body parsing
🔧 Fix:
- Use req.body directly instead of req.text() + JSON.parse()
- Match pattern used in working auth endpoints
- Should resolve NOT_FOUND and parsing issues
2025-07-22 07:09:14 -05:00
Randall Stillwell
f7735ba8d9 Add user promotion endpoint
🔧 Admin Management:
- Add api/admin/promote-user.js endpoint
- Allows promoting users to admin role by username or userId
- Checks for existing admin status
- Returns updated user info with roles
- Handles database errors gracefully

Usage: POST /api/admin/promote-user with { username: 'testuser' }
2025-07-22 07:08:09 -05:00