Fixed getAll array parsing

This commit is contained in:
konrad 2019-02-23 21:20:22 +01:00
parent 2d4ee63e1f
commit 7c809e7471
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -222,6 +222,11 @@ export default class AbstractService {
return this.errorHandler(error)
})
.then(response => {
if (Array.isArray(response.data)) {
return Promise.resolve(response.data.map(entry => {
return this.modelFactory(entry)
}))
}
return Promise.resolve(this.modelFactory(response.data))
})
.finally(() => {