fix inquiry message emails
This commit is contained in:
parent
81f0113ce2
commit
09cdce350d
@ -90,6 +90,7 @@ export async function sendNewInquiryEmail(inquiryId: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function sendInquiryMessageEmail(inquiryId: number, sender: Sender) {
|
export async function sendInquiryMessageEmail(inquiryId: number, sender: Sender) {
|
||||||
|
console.log(inquiryId);
|
||||||
const [item]: Item[] = await sql`
|
const [item]: Item[] = await sql`
|
||||||
SELECT
|
SELECT
|
||||||
i.*,
|
i.*,
|
||||||
|
|||||||
@ -84,7 +84,6 @@ export const actions: Actions = {
|
|||||||
|
|
||||||
const body = getRequiredFormString(data, 'message');
|
const body = getRequiredFormString(data, 'message');
|
||||||
|
|
||||||
console.log(inquiryId, sender, body);
|
|
||||||
const response = await sql`
|
const response = await sql`
|
||||||
INSERT INTO inquiry_messages (thread_id, sender, body)
|
INSERT INTO inquiry_messages (thread_id, sender, body)
|
||||||
VALUES (${inquiryId}, ${sender}, ${body})
|
VALUES (${inquiryId}, ${sender}, ${body})
|
||||||
@ -97,7 +96,7 @@ export const actions: Actions = {
|
|||||||
} else {
|
} else {
|
||||||
nextReplySender = Sender.FINDER;
|
nextReplySender = Sender.FINDER;
|
||||||
}
|
}
|
||||||
await sendInquiryMessageEmail(response[0].threadId, nextReplySender);
|
await sendInquiryMessageEmail(inquiryId, nextReplySender);
|
||||||
|
|
||||||
return { success: true };
|
return { success: true };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user