summaryrefslogtreecommitdiffstats
path: root/server/api/clients.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-11-12 08:26:40 +0100
committerJannik Schönartz2018-11-12 08:26:40 +0100
commitb25692fdd948d25b2dcf39bd775d50849014c180 (patch)
tree45d76aa1ca78ea5dcf4937895b8d1a74934afa41 /server/api/clients.js
parent[registration] add configurator for registration hooks (diff)
downloadbas-b25692fdd948d25b2dcf39bd775d50849014c180.tar.gz
bas-b25692fdd948d25b2dcf39bd775d50849014c180.tar.xz
bas-b25692fdd948d25b2dcf39bd775d50849014c180.zip
[idoit] Clients are now added to the idoit backend
Delete client in the backends if client is deleted in the bas. Add method for creating the client in the backends Add method for adding additional information to the client in the backend Add backend helper for calling all backends with the matching external id Add idoit mehtod for creating and updating a client
Diffstat (limited to 'server/api/clients.js')
-rw-r--r--server/api/clients.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/api/clients.js b/server/api/clients.js
index 3e257e2..0fbb7af 100644
--- a/server/api/clients.js
+++ b/server/api/clients.js
@@ -1,6 +1,7 @@
/* global __appdir */
var path = require('path')
var db = require(path.join(__appdir, 'lib', 'sequelize'))
+const backendHelper = require(path.join(__appdir, 'lib', 'external-backends', 'backendhelper'))
// GET Requests
module.exports.get = {
@@ -42,5 +43,6 @@ module.exports.post = {
// delete clients
delete: function (req, res) {
db.client.destroy({ where: { id: req.body.ids } }).then(count => { res.send({ count }) })
+ backendHelper.deleteClients(req.body.ids)
}
}