summaryrefslogtreecommitdiffstats
path: root/server/api/backends.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/api/backends.js')
-rw-r--r--server/api/backends.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/api/backends.js b/server/api/backends.js
index 1d8e96d..1f9535b 100644
--- a/server/api/backends.js
+++ b/server/api/backends.js
@@ -165,8 +165,8 @@ router.get('/:id/import', (req, res) => {
var endRequest = []
const ba = new ExternalBackends()
const instance = ba.getInstance(backend.type)
- const groups = JSON.parse(backend.groupTypes).map(x => x.id)
- const clients = JSON.parse(backend.clientTypes).map(x => x.id)
+ const groups = JSON.parse(backend.groupTypes).map(x => parseInt(x.id))
+ const clients = JSON.parse(backend.clientTypes).map(x => parseInt(x.id))
// Get a list with all objects in the backend.
const objectPromise = new Promise(function (resolve, reject) {
@@ -175,7 +175,7 @@ router.get('/:id/import', (req, res) => {
objectPromise.then(result => {
// Check for the not implemented exception
- if (result.status) res.status(501).send(result)
+ if (result.status === 'NOT_IMPLEMENTED_EXCEPTION') res.status(501).send(result)
// Filter those objects in groups / clients
var groupObjects = []
@@ -312,7 +312,7 @@ noAuthRouter.get('/:id/:uuid/files/:filename', (req, res) => {
const instance = b.getInstance(backend.type)
instance.getFile(backend.credentials, externalId, filename).then(file => {
file.decoded = Buffer.from(file.value, 'base64').toString('UTF-8')
- res.send({ success: true, data: file })
+ res.send(file)
})
} else {
res.send({ success: false, status: 'CLIENT_NOT_FOUND', error: 'Couldn\'t find the client' })