diff --git a/packages/core/src/queries/passcode.test.ts b/packages/core/src/queries/passcode.test.ts index 9afbada45..135355a4e 100644 --- a/packages/core/src/queries/passcode.test.ts +++ b/packages/core/src/queries/passcode.test.ts @@ -133,12 +133,12 @@ describe('passcode query', () => { const ids = ['foo', 'foo2']; const expectSql = sql` delete from ${table} - where ${fields.id} in (${ids.join(',')}) + where ${fields.id} in (${sql.join(ids, sql`,`)}) `; mockQuery.mockImplementationOnce(async (sql, values) => { expectSqlAssert(sql, expectSql.sql); - expect(values).toEqual([ids.join(',')]); + expect(values).toEqual(ids); return createMockQueryResult([mockPasscode, mockPasscode]); }); @@ -150,12 +150,12 @@ describe('passcode query', () => { const ids = ['foo', 'foo2']; const expectSql = sql` delete from ${table} - where ${fields.id} in (${ids.join(',')}) + where ${fields.id} in (${sql.join(ids, sql`,`)}) `; mockQuery.mockImplementationOnce(async (sql, values) => { expectSqlAssert(sql, expectSql.sql); - expect(values).toEqual([ids.join(',')]); + expect(values).toEqual(ids); return createMockQueryResult([mockPasscode]); }); diff --git a/packages/core/src/queries/passcode.ts b/packages/core/src/queries/passcode.ts index 29f9ae69b..3dc2f0be7 100644 --- a/packages/core/src/queries/passcode.ts +++ b/packages/core/src/queries/passcode.ts @@ -56,7 +56,7 @@ export const deletePasscodeById = async (id: string) => { export const deletePasscodesByIds = async (ids: string[]) => { const { rowCount } = await envSet.pool.query(sql` delete from ${table} - where ${fields.id} in (${ids.join(',')}) + where ${fields.id} in (${sql.join(ids, sql`,`)}) `); if (rowCount !== ids.length) {