1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

Default to empty array results in Ember services

This commit is contained in:
McMatts 2018-03-23 11:50:21 +00:00
parent 38e8c4665a
commit 8d65c2d571
10 changed files with 36 additions and 11 deletions

View file

@ -35,6 +35,7 @@ export default BaseService.extend({
method: 'GET'
}).then((response) => {
let data = [];
if (is.not.array(response)) response = [];
data = response.map((obj) => {
let data = this.get('store').normalize('group', obj);
@ -81,7 +82,7 @@ export default BaseService.extend({
return data;
});
},
// join adds user to group.
join(groupId, userId) {
return this.get('ajax').request(`group/${groupId}/join/${userId}`, {