-
Notifications
You must be signed in to change notification settings - Fork 3
Fixes that workflow reminders of cancelled and rescheduled bookings are still sent #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8daa5c4
b62459d
de55c8f
b3c107f
c416294
2fdb95b
ad9a0a8
6048e2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,20 +194,41 @@ export const scheduleEmailReminder = async ( | |
| } | ||
| }; | ||
|
|
||
| export const deleteScheduledEmailReminder = async (referenceId: string) => { | ||
| export const deleteScheduledEmailReminder = async ( | ||
| reminderId: number, | ||
| referenceId: string | null, | ||
| immediateDelete?: boolean | ||
| ) => { | ||
| try { | ||
| await client.request({ | ||
| url: "/v3/user/scheduled_sends", | ||
| method: "POST", | ||
| body: { | ||
| batch_id: referenceId, | ||
| status: "cancel", | ||
| }, | ||
| }); | ||
| if (!referenceId) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 AI 代码审查发现问题 📋 问题概述
📍 问题详情🔴 问题 1 | 严重程度:
|
||
| await prisma.workflowReminder.delete({ | ||
| where: { | ||
| id: reminderId, | ||
| }, | ||
| }); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| await client.request({ | ||
| url: `/v3/user/scheduled_sends/${referenceId}`, | ||
| method: "DELETE", | ||
| if (immediateDelete) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 AI 代码审查发现问题 📋 问题概述
📍 问题详情🟡 问题 1 | 严重程度:
|
||
| await client.request({ | ||
| url: "/v3/user/scheduled_sends", | ||
| method: "POST", | ||
| body: { | ||
| batch_id: referenceId, | ||
| status: "cancel", | ||
| }, | ||
| }); | ||
| return; | ||
| } | ||
|
|
||
| await prisma.workflowReminder.update({ | ||
| where: { | ||
| id: reminderId, | ||
| }, | ||
| data: { | ||
| cancelled: true, | ||
| }, | ||
| }); | ||
| } catch (error) { | ||
| console.log(`Error canceling reminder with error ${error}`); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 AI 代码审查发现问题 📋 问题概述
📍 问题详情🟡 问题 1 | 严重程度:
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,9 +174,16 @@ export const scheduleSMSReminder = async ( | |
| } | ||
| }; | ||
|
|
||
| export const deleteScheduledSMSReminder = async (referenceId: string) => { | ||
| export const deleteScheduledSMSReminder = async (reminderId: number, referenceId: string | null) => { | ||
| try { | ||
| await twilio.cancelSMS(referenceId); | ||
| if (referenceId) { | ||
| await twilio.cancelSMS(referenceId); | ||
| } | ||
| await prisma.workflowReminder.delete({ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 AI 代码审查发现问题 📋 问题概述
📍 问题详情🟡 问题 1 | 严重程度:
|
||
| where: { | ||
| id: reminderId, | ||
| }, | ||
| }); | ||
| } catch (error) { | ||
| console.log(`Error canceling reminder with error ${error}`); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 AI 代码审查发现问题 📋 问题概述
📍 问题详情🟡 问题 1 | 严重程度:
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "WorkflowReminder" ADD COLUMN "cancelled" BOOLEAN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 AI 代码审查发现问题
📋 问题概述
📍 问题详情
🟡 问题 1 | 严重程度:
MEDIUM| 行号:966💬 详细说明:
📝 问题代码:
💡 修复建议:
✅ 修复示例:
🔗 参考链接
无