Add account deletion API

This commit is contained in:
Jonas Lochmann
2023-04-09 14:30:26 +02:00
parent 05fac79849
commit e46f5bea3f
20 changed files with 705 additions and 119 deletions
+7 -4
View File
@@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 - 2020 Jonas Lochmann
* Copyright (C) 2019 - 2023 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -26,9 +26,12 @@ export async function deleteOldFamilies (database: Database) {
if (oldFamilyIds.length > 0) {
const familyIdsToDelete = oldFamilyIds.slice(0, 256) /* limit to 256 families per execution */
await deleteFamilies({
database,
familiyIds: familyIdsToDelete
await database.transaction(async (transaction) => {
await deleteFamilies({
database,
transaction,
familiyIds: familyIdsToDelete
})
})
}
}