repair: notification error log created_by
This commit is contained in:
@@ -45,7 +45,27 @@ const getNotificationErrorLogByNotificationErrorIdDb = async (notificationErrorI
|
||||
};
|
||||
|
||||
const createNotificationErrorLogDb = async (store) => {
|
||||
const { query: queryText, values } = pool.buildDynamicInsert("notification_error_log", store);
|
||||
const queryText = `
|
||||
INSERT INTO notification_error_log (
|
||||
notification_error_id,
|
||||
contact_phone,
|
||||
notification_error_log_description,
|
||||
created_by,
|
||||
updated_by,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
VALUES ($1, $2, $3, $4, $4, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
|
||||
SELECT SCOPE_IDENTITY() as inserted_id;
|
||||
`;
|
||||
|
||||
const values = [
|
||||
store.notification_error_id,
|
||||
store.contact_phone,
|
||||
store.notification_error_log_description,
|
||||
store.created_by
|
||||
];
|
||||
|
||||
const result = await pool.query(queryText, values);
|
||||
const insertedId = result.recordset[0]?.inserted_id;
|
||||
return insertedId ? await getNotificationErrorLogByIdDb(insertedId) : null;
|
||||
|
||||
Reference in New Issue
Block a user