add: reader in notification detail & update notification
This commit is contained in:
@@ -53,6 +53,23 @@ class NotificationErrorController {
|
||||
|
||||
return res.status(response.statusCode).json(response);
|
||||
}
|
||||
|
||||
static async update(req, res) {
|
||||
const { id } = req.params;
|
||||
|
||||
const { error, value } = checkValidate(updateNotificationSchema, req)
|
||||
|
||||
if (error) {
|
||||
return res.status(400).json(setResponse(error, 'Validation failed', 400));
|
||||
}
|
||||
|
||||
value.userId = req.user.user_id
|
||||
|
||||
const results = await NotificationErrorService.updateNotificationError(id, value);
|
||||
const response = await setResponse(results, 'Notification Error User updated successfully')
|
||||
|
||||
res.status(response.statusCode).json(response);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NotificationErrorController;
|
||||
|
||||
@@ -52,17 +52,17 @@ class NotificationErrorUserController {
|
||||
value.userId = req.user.user_id
|
||||
|
||||
const results = await NotificationErrorUserService.updateNotificationErrorUser(id, value);
|
||||
const response = await setResponse(results, 'Contact updated successfully')
|
||||
const response = await setResponse(results, 'Notification Error User updated successfully')
|
||||
|
||||
res.status(response.statusCode).json(response);
|
||||
}
|
||||
|
||||
// Soft delete contact
|
||||
// Soft delete Notification Error User
|
||||
static async delete(req, res) {
|
||||
const { id } = req.params;
|
||||
|
||||
const results = await NotificationErrorUserService.deleteNotificationErrorUser(id, req.user.user_id);
|
||||
const response = await setResponse(results, 'Contact deleted successfully')
|
||||
const response = await setResponse(results, 'Notification Error User deleted successfully')
|
||||
|
||||
res.status(response.statusCode).json(response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user