From b25692fdd948d25b2dcf39bd775d50849014c180 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Mon, 12 Nov 2018 07:26:40 +0000 Subject: [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 --- server/api/clients.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server/api/clients.js') 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) } } -- cgit v1.2.3-55-g7522