repair get notification error detail

This commit is contained in:
2025-11-18 13:35:58 +07:00
parent 919824bb41
commit 46c69aafa0
4 changed files with 153 additions and 4 deletions

View File

@@ -57,9 +57,21 @@ const deleteErrorCodeDb = async (brandId, errorCode, deletedBy) => {
return true;
};
// Get error code by error_code_id
const getErrorCodeByIdDb = async (error_code_id) => {
const queryText = `
SELECT
a.*
FROM brand_code a
WHERE a.error_code_id = $1 AND a.deleted_at IS NULL
`;
const result = await pool.query(queryText, [error_code_id]);
return result.recordset[0];
};
module.exports = {
getErrorCodesByBrandIdDb,
getErrorCodeByIdDb,
createErrorCodeDb,
updateErrorCodeDb,
deleteErrorCodeDb,