feature/worker #111

Merged
primakov merged 190 commits from feature/worker into master 2025-12-05 16:59:42 +03:00
Showing only changes of commit f5faae7907 - Show all commits

View File

@@ -92,4 +92,13 @@ exports.logout = (req, res) => {
}),
_meta: {}
});
};
exports.updateProfile = (req, res) => {
const userId = req.user?.id || req.body.id; // 这里假设有用户认证中间件否则用body.id
if (!userId) return res.status(401).json({ error: 'Unauthorized' });
const { firstName, lastName, bio, location, website } = req.body;
const updated = require('../../shared/usersDb').updateUser(userId, { firstName, lastName, bio, location, website });
if (!updated) return res.status(404).json({ error: 'User not found' });
res.json({ success: true, user: updated });
};