misc: migrated to native DAL method

This commit is contained in:
Sheen Capadngan
2024-05-27 11:01:22 +08:00
parent 59c8dc3cda
commit 3639a7fc18
2 changed files with 2 additions and 16 deletions
+1 -15
View File
@@ -143,19 +143,6 @@ export const userDALFactory = (db: TDbClient) => {
}
};
const incrementFailedMfaAttempt = async (userId: string, tx?: Knex) => {
try {
const [user] = await (tx || db)(TableName.Users)
.where("id", userId)
.increment("consecutiveFailedMfaAttempts", 1)
.returning("*");
return user;
} catch (error) {
throw new DatabaseError({ error, name: "Increment Failed MFA Attempt" });
}
};
return {
...userOrm,
findUserByUsername,
@@ -168,7 +155,6 @@ export const userDALFactory = (db: TDbClient) => {
upsertUserEncryptionKey,
createUserEncryption,
findOneUserAction,
createUserAction,
incrementFailedMfaAttempt
createUserAction
};
};