Profile saving works
This commit is contained in:
@@ -105,6 +105,13 @@ router.patch('/profile', async (req, res) => {
|
||||
if (!token) return res.status(401).json({ error: 'Unauthorized' });
|
||||
|
||||
const { userId, profile } = req.body;
|
||||
console.log('DEBUG: Updating profile for', userId, profile);
|
||||
|
||||
// Convert birthDate from timestamp to Date object if needed
|
||||
if (profile.birthDate) {
|
||||
// Handle both number (timestamp) and string (ISO)
|
||||
profile.birthDate = new Date(profile.birthDate);
|
||||
}
|
||||
|
||||
// Verify token
|
||||
const decoded = jwt.verify(token, JWT_SECRET) as any;
|
||||
|
||||
Reference in New Issue
Block a user