repair: notification_log
This commit is contained in:
@@ -55,7 +55,18 @@ class NotificationErrorLogController {
|
||||
return res.status(400).json(setResponse(error, 'Validation failed', 400));
|
||||
}
|
||||
|
||||
value.created_by = req.user.user_id;
|
||||
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 response = await setResponse(results, 'Notification Error Log created successfully')
|
||||
|
||||
Reference in New Issue
Block a user