repair: get all notification

This commit is contained in:
2025-11-17 11:14:36 +07:00
parent ac68a380dd
commit ff4176f8f9
3 changed files with 33 additions and 24 deletions

View File

@@ -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);
}