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:
parent
38e8c4665a
commit
8d65c2d571
10 changed files with 36 additions and 11 deletions
|
@ -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}`, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue