repair: body message wa in notif

This commit is contained in:
2026-01-06 14:37:52 +07:00
parent 6f4d171537
commit b025c5ea82
4 changed files with 161 additions and 94 deletions

View File

@@ -43,6 +43,22 @@ const getNotificationByIdDb = async (id) => {
return result.recordset[0];
};
const getDeviceNotificationByIdDb = async (chanel_id) => {
const queryText = `
SELECT
device_code,
device_name,
device_location,
listen_channel
FROM m_device
WHERE listen_channel = $1
AND deleted_at IS NULL
`;
const result = await pool.query(queryText, [chanel_id]);
return result.recordset[0];
};
const getAllNotificationDb = async (searchParams = {}) => {
let queryParams = [];
@@ -185,6 +201,7 @@ const getUsersNotificationErrorDb = async (id) => {
module.exports = {
getNotificationByIdDb,
getDeviceNotificationByIdDb,
getAllNotificationDb,
InsertNotificationErrorDb,
updateNotificationErrorDb,