fixing is delivered notification wa
This commit is contained in:
@@ -96,8 +96,8 @@ const getAllNotificationDb = async (searchParams = {}) => {
|
||||
],
|
||||
queryParams
|
||||
);
|
||||
|
||||
queryParams = whereParamAnd ? whereParamAnd : queryParams;
|
||||
|
||||
queryParams = whereParamAnd ? whereParamAnd : queryParams;
|
||||
|
||||
const queryText = `
|
||||
SELECT
|
||||
@@ -131,17 +131,17 @@ const getAllNotificationDb = async (searchParams = {}) => {
|
||||
|
||||
FROM notification_error a
|
||||
|
||||
LEFT JOIN brand_code b
|
||||
ON a.error_code_id = b.error_code_id AND b.deleted_at IS NULL
|
||||
|
||||
LEFT JOIN brand_code_solution c
|
||||
ON b.error_code_id = c.error_code_id AND c.deleted_at IS NULL
|
||||
|
||||
LEFT JOIN m_device d
|
||||
ON a.error_chanel = d.listen_channel AND d.deleted_at IS NULL
|
||||
|
||||
LEFT JOIN brand_code b
|
||||
ON a.error_code_id = b.error_code AND b.deleted_at IS NULL AND d.brand_id = b.brand_id
|
||||
|
||||
LEFT JOIN brand_code_solution c
|
||||
ON b.error_code_id = c.error_code_id AND c.deleted_at IS NULL
|
||||
|
||||
LEFT JOIN m_brands e
|
||||
ON d.brand_id = e.brand_id AND d.deleted_at IS NULL
|
||||
ON d.brand_id = e.brand_id AND e.deleted_at IS NULL
|
||||
|
||||
WHERE a.deleted_at IS NULL
|
||||
${whereConditions.length > 0 ? ` AND ${whereConditions.join(" AND ")}` : ""}
|
||||
@@ -173,7 +173,7 @@ const updateNotificationErrorDb = async (id, data) => {
|
||||
);
|
||||
|
||||
await pool.query(`${queryText} AND deleted_at IS NULL`, values);
|
||||
return getNotificationByIdDb(id);
|
||||
return getNotificationByIdDb(id);
|
||||
};
|
||||
|
||||
const getUsersNotificationErrorDb = async (id) => {
|
||||
@@ -196,7 +196,7 @@ const getUsersNotificationErrorDb = async (id) => {
|
||||
WHERE a.notification_error_id = $1
|
||||
AND a.deleted_at IS NULL
|
||||
`;
|
||||
|
||||
|
||||
const result = await pool.query(queryText, [id]);
|
||||
return result.recordset;
|
||||
};
|
||||
@@ -208,5 +208,5 @@ module.exports = {
|
||||
InsertNotificationErrorDb,
|
||||
updateNotificationErrorDb,
|
||||
getUsersNotificationErrorDb
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user