repair: get all notification
This commit is contained in:
@@ -4,15 +4,12 @@ const { insertNotificationSchema, updateNotificationSchema } = require('../valid
|
||||
|
||||
class NotificationController {
|
||||
static async getAll(req, res) {
|
||||
try {
|
||||
const queryParams = req.query;
|
||||
const results = await NotificationService.getAllNotification(queryParams);
|
||||
const response = await setResponsePaging(queryParams, results, 'Notification list retrieved successfully');
|
||||
return res.status(response.statusCode).json(response);
|
||||
} catch (err) {
|
||||
console.error("Notification Error:", err.message);
|
||||
return res.status(500).json(setResponse(err, 'Failed to fetch notifications', 500));
|
||||
}
|
||||
const queryParams = req.query;
|
||||
|
||||
const results = await NotificationService.getAllNotification(queryParams);
|
||||
const response = await setResponsePaging(queryParams, results, 'Notification found')
|
||||
|
||||
res.status(response.statusCode).json(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user