Skip to content

Commit

Permalink
add log to check for broken field
Browse files Browse the repository at this point in the history
  • Loading branch information
elvisduru committed Mar 20, 2024
1 parent 8bff667 commit 948cc9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mail/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,12 @@ export const sendContactMail = async (form: Record<string, any>) => {
console.debug("FINDING RECORD", findRecordQuery, tableSlug);

const res = await request(`${BAMBOO_SERVER_HOST}/${BAMBOO_SERVER_APP_ID}`, findRecordQuery);
console.debug("FIND_RECORD_RESPONSE", res);

const isExistingRecord = res[tableSlug].records.result[0]?.id;

console.debug("RECORD FOUND", isExistingRecord);

await sendDataToBambooTable(form, tableSlug);
if (!isExistingRecord) await sendMail(form);
} catch {
Expand Down

0 comments on commit 948cc9a

Please sign in to comment.