Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getQueryToFindOwnerAndCategoryNo = (id, sender = false) => {
return mysql.format(QUERY.SELECT, [
IDENTIFIER.USER_NO,
VALUE.OWNER,
IDENTIFIER.CATEGORY_NO,
[TABLE.USER, TABLE.CATEGORY],
IDENTIFIER.USER_NO,
IDENTIFIER.CATEGORY_USER_NO,
IDENTIFIER.ID,
id,
IDENTIFIER.CATEGOTY_NAME,
sender ? VALUE.SENT_MAILBOX : VALUE.MAILBOX
]);
};
text,
html,
attachments
}) => {
const valueOfMailTemplate = {
from,
to,
subject,
text,
html,
created_at: VALUE.NOW,
updated_at: VALUE.NOW,
has_attachment: attachments.length !== 0
};
return mysql.format(QUERY.INSERT, [TABLE.MAIL_TEMPLATE, valueOfMailTemplate]);
};