summaryrefslogtreecommitdiffstats
path: root/server/lib
diff options
context:
space:
mode:
authorJannik Schönartz2019-10-16 21:16:14 +0200
committerJannik Schönartz2019-10-16 21:16:14 +0200
commit4752614c0105b864d00e97179b4b77ccbad89e2d (patch)
tree88f89882295efda36ea71292241e80922694e85e /server/lib
parent[documentation] Add more information about the automatic registration & chang... (diff)
downloadbas-4752614c0105b864d00e97179b4b77ccbad89e2d.tar.gz
bas-4752614c0105b864d00e97179b4b77ccbad89e2d.tar.xz
bas-4752614c0105b864d00e97179b4b77ccbad89e2d.zip
[webapp/clients] Add the choice to select backends when deleting clients
[group/clients] Checkbox list of the clients in the permanently delete dialog [server/backendhelper] Only deletes from the selected backends (array with backendids)
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/external-backends/backendhelper.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/lib/external-backends/backendhelper.js b/server/lib/external-backends/backendhelper.js
index 7e682d1..485b5f6 100644
--- a/server/lib/external-backends/backendhelper.js
+++ b/server/lib/external-backends/backendhelper.js
@@ -116,9 +116,15 @@ async function updateClient (client) {
return result
}
-async function deleteClients (clientids) {
+async function deleteClients (clientids, backendIds) {
// Get all backends and call deleteClient for each instance.
- const backends = await db.backend.findAll({ where: { '$clientMappings.clientid$': clientids }, include: ['clientMappings'] })
+ const backends = await db.backend.findAll({
+ where: {
+ id: { [db.Op.in]: backendIds },
+ '$clientMappings.clientid$': clientids
+ },
+ include: ['clientMappings']
+ })
backends.forEach(backend => {
const ba = new ExternalBackends()