feat: enhance terms acceptance response to include acceptance timestamp

This commit is contained in:
Marco Beretta 2025-12-07 04:04:26 +01:00
parent 4fe9e98442
commit d6d61254ad
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
3 changed files with 7 additions and 3 deletions

View file

@ -96,7 +96,10 @@ const acceptTermsController = async (req, res) => {
if (!user) {
return res.status(404).json({ message: 'User not found' });
}
res.status(200).json({ message: 'Terms accepted successfully' });
res.status(200).json({
message: 'Terms accepted successfully',
termsAcceptedAt: user.termsAcceptedAt,
});
} catch (error) {
logger.error('Error accepting terms:', error);
res.status(500).json({ message: 'Error accepting terms' });