repair: notification error
This commit is contained in:
25
controllers/notification_error.controller.js
Normal file
25
controllers/notification_error.controller.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const NotificationErrorService = require('../services/notification_error.service');
|
||||
const { setResponse, setResponsePaging, checkValidate } = require('../helpers/utils');
|
||||
|
||||
class NotificationErrorController {
|
||||
static async getAll(req, res) {
|
||||
const queryParams = req.query;
|
||||
|
||||
const results = await NotificationErrorService.getAllNotification(queryParams);
|
||||
const response = await setResponsePaging(queryParams, results, 'Notification found')
|
||||
|
||||
res.status(response.statusCode).json(response);
|
||||
}
|
||||
|
||||
static async getById(req, res) {
|
||||
const { id } = req.params;
|
||||
|
||||
const results = await NotificationErrorService.getNotificationById(id);
|
||||
const response = await setResponse(results, 'Notification retrieved successfully');
|
||||
|
||||
return res.status(response.statusCode).json(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = NotificationErrorController;
|
||||
Reference in New Issue
Block a user