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
This commit is contained in:
parent
f7735ba8d9
commit
028c5396f3
1 changed files with 1 additions and 2 deletions
|
|
@ -11,8 +11,7 @@ export default async function handler(req, res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const body = JSON.parse(req.body || '{}');
|
const { username, userId } = req.body;
|
||||||
const { username, userId } = body;
|
|
||||||
|
|
||||||
if (!username && !userId) {
|
if (!username && !userId) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue