fix(GRO-639): replace raw SQL ANY() with Drizzle inArray
- Replace raw sql template literal with Drizzle inArray for reminderLogs query (P1 fix per CTO review of PR #306) - inArray is already used in payment.ts and portal.ts Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -5,8 +5,8 @@ import {
|
||||
eq,
|
||||
getDb,
|
||||
gte,
|
||||
inArray,
|
||||
lt,
|
||||
sql,
|
||||
appointments,
|
||||
clients,
|
||||
pets,
|
||||
@@ -77,9 +77,7 @@ export async function runReminderCheck(): Promise<void> {
|
||||
.where(
|
||||
and(
|
||||
eq(reminderLogs.reminderType, window.label),
|
||||
appointmentIds.length === 1
|
||||
? eq(reminderLogs.appointmentId, appointmentIds[0]!)
|
||||
: sql`${reminderLogs.appointmentId} = ANY(${appointmentIds})`
|
||||
inArray(reminderLogs.appointmentId, appointmentIds)
|
||||
)
|
||||
)
|
||||
).map((r) => r.appointmentId)
|
||||
|
||||
Reference in New Issue
Block a user