mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Add deleting session durations when deleting families
For the automatic deletion, they were always already deleted. However, for manual deletion, this is required.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -79,6 +79,16 @@ export async function deleteFamilies ({ database, familiyIds }: {
|
|||||||
transaction
|
transaction
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// session durations
|
||||||
|
await database.sessionDuration.destroy({
|
||||||
|
where: {
|
||||||
|
familyId: {
|
||||||
|
[Sequelize.Op.in]: familiyIds
|
||||||
|
}
|
||||||
|
},
|
||||||
|
transaction
|
||||||
|
})
|
||||||
|
|
||||||
// user
|
// user
|
||||||
await database.user.destroy({
|
await database.user.destroy({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
Reference in New Issue
Block a user