repair: notification error log created_by

This commit is contained in:
2025-12-23 17:54:14 +07:00
parent 10b7ac5e68
commit a704eb3235
3 changed files with 45 additions and 18 deletions

View File

@@ -55,20 +55,7 @@ class NotificationErrorLogController {
return res.status(400).json(setResponse(error, 'Validation failed', 400));
}
let createdBy, contactPhone;
if (!isNaN(req.user.userId) && Number(req.user.userId) > 0) {
createdBy = Number(req.user.userId);
contactPhone = value.contact_phone || null;
} else {
createdBy = null;
contactPhone = req.user.userId;
}
value.created_by = createdBy;
value.contact_phone = contactPhone;
const results = await NotificationErrorLogService.createNotificationErrorLog(value);
const results = await NotificationErrorLogService.createNotificationErrorLog(value, req.user.user_id);
const response = await setResponse(results, 'Notification Error Log created successfully')
return res.status(response.statusCode).json(response);