mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-12-03 18:36:05 +00:00
angular-in-memory-web-api updated to v0.5.0,
(HTTP response data no longer wrapped in object w/ data property by default.)
This commit is contained in:
@@ -35,7 +35,7 @@ export class CalendarService implements Resolve<any>
|
||||
|
||||
this.http.get('api/calendar/events')
|
||||
.subscribe((response: any) => {
|
||||
this.events = response.data.data;
|
||||
this.events = response.data;
|
||||
this.onEventsUpdated.next(this.events);
|
||||
resolve(this.events);
|
||||
}, reject);
|
||||
|
||||
@@ -48,7 +48,7 @@ export class ChatService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/chat-chats/' + chatItem.id)
|
||||
.subscribe((response: any) => {
|
||||
const chat = response.data;
|
||||
const chat = response;
|
||||
|
||||
const chatContact = this.contacts.find((contact) => {
|
||||
return contact.id === contactId;
|
||||
@@ -212,7 +212,7 @@ export class ChatService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/chat-contacts')
|
||||
.subscribe((response: any) => {
|
||||
resolve(response.data);
|
||||
resolve(response);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
@@ -226,7 +226,7 @@ export class ChatService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/chat-chats')
|
||||
.subscribe((response: any) => {
|
||||
resolve(response.data);
|
||||
resolve(response);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
@@ -240,7 +240,7 @@ export class ChatService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/chat-user')
|
||||
.subscribe((response: any) => {
|
||||
resolve(response.data[0]);
|
||||
resolve(response[0]);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export class ContactsService implements Resolve<any>
|
||||
this.http.get('api/contacts-contacts')
|
||||
.subscribe((response: any) => {
|
||||
|
||||
this.contacts = response.data;
|
||||
this.contacts = response;
|
||||
|
||||
if ( this.filterBy === 'starred' )
|
||||
{
|
||||
@@ -104,7 +104,7 @@ export class ContactsService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/contacts-user/5725a6802d10e277a0f35724')
|
||||
.subscribe((response: any) => {
|
||||
this.user = response.data;
|
||||
this.user = response;
|
||||
this.onUserDataChanged.next(this.user);
|
||||
resolve(this.user);
|
||||
}, reject);
|
||||
|
||||
@@ -43,8 +43,8 @@ export class ProjectsDashboardService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/projects-dashboard-projects')
|
||||
.subscribe((response: any) => {
|
||||
this.projects = response.data;
|
||||
resolve(response.data);
|
||||
this.projects = response;
|
||||
resolve(response);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
@@ -54,8 +54,8 @@ export class ProjectsDashboardService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/projects-dashboard-widgets')
|
||||
.subscribe((response: any) => {
|
||||
this.widgets = response.data;
|
||||
resolve(response.data);
|
||||
this.widgets = response;
|
||||
resolve(response);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ export class FileManagerService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/file-manager')
|
||||
.subscribe((response: any) => {
|
||||
this.onFilesChanged.next(response.data);
|
||||
this.onFileSelected.next(response.data[0]);
|
||||
resolve(response.data);
|
||||
this.onFilesChanged.next(response);
|
||||
this.onFileSelected.next(response[0]);
|
||||
resolve(response);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ export class MailService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/mail-folders')
|
||||
.subscribe((response: any) => {
|
||||
this.folders = response.data;
|
||||
this.folders = response;
|
||||
this.onFoldersChanged.next(this.folders);
|
||||
resolve(this.folders);
|
||||
}, reject);
|
||||
@@ -105,7 +105,7 @@ export class MailService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/mail-filters')
|
||||
.subscribe((response: any) => {
|
||||
this.filters = response.data;
|
||||
this.filters = response;
|
||||
this.onFiltersChanged.next(this.filters);
|
||||
resolve(this.filters);
|
||||
}, reject);
|
||||
@@ -121,7 +121,7 @@ export class MailService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/mail-labels')
|
||||
.subscribe((response: any) => {
|
||||
this.labels = response.data;
|
||||
this.labels = response;
|
||||
this.onLabelsChanged.next(this.labels);
|
||||
resolve(this.labels);
|
||||
}, reject);
|
||||
@@ -159,12 +159,12 @@ export class MailService implements Resolve<any>
|
||||
this.http.get('api/mail-folders?handle=' + handle)
|
||||
.subscribe((folders: any) => {
|
||||
|
||||
const folderId = folders.data[0].id;
|
||||
const folderId = folders[0].id;
|
||||
|
||||
this.http.get('api/mail-mails?folder=' + folderId)
|
||||
.subscribe((mails: any) => {
|
||||
|
||||
this.mails = mails.data.map(mail => {
|
||||
this.mails = mails.map(mail => {
|
||||
return new Mail(mail);
|
||||
});
|
||||
|
||||
@@ -191,7 +191,7 @@ export class MailService implements Resolve<any>
|
||||
this.http.get('api/mail-mails?' + handle + '=true')
|
||||
.subscribe((mails: any) => {
|
||||
|
||||
this.mails = mails.data.map(mail => {
|
||||
this.mails = mails.map(mail => {
|
||||
return new Mail(mail);
|
||||
});
|
||||
|
||||
@@ -216,12 +216,12 @@ export class MailService implements Resolve<any>
|
||||
this.http.get('api/mail-labels?handle=' + handle)
|
||||
.subscribe((labels: any) => {
|
||||
|
||||
const labelId = labels.data[0].id;
|
||||
const labelId = labels[0].id;
|
||||
|
||||
this.http.get('api/mail-mails?labels=' + labelId)
|
||||
.subscribe((mails: any) => {
|
||||
|
||||
this.mails = mails.data.map(mail => {
|
||||
this.mails = mails.map(mail => {
|
||||
return new Mail(mail);
|
||||
});
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class ScrumboardService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/scrumboard-boards')
|
||||
.subscribe((response: any) => {
|
||||
this.boards = response.data;
|
||||
this.boards = response;
|
||||
this.onBoardsChanged.next(this.boards);
|
||||
resolve(this.boards);
|
||||
}, reject);
|
||||
@@ -57,7 +57,7 @@ export class ScrumboardService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/scrumboard-boards/' + boardId)
|
||||
.subscribe((response: any) => {
|
||||
this.board = response.data;
|
||||
this.board = response;
|
||||
this.onBoardChanged.next(this.board);
|
||||
resolve(this.board);
|
||||
}, reject);
|
||||
|
||||
@@ -92,7 +92,7 @@ export class TodoService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/todo-filters')
|
||||
.subscribe((response: any) => {
|
||||
this.filters = response.data;
|
||||
this.filters = response;
|
||||
this.onFiltersChanged.next(this.filters);
|
||||
resolve(this.filters);
|
||||
}, reject);
|
||||
@@ -108,7 +108,7 @@ export class TodoService implements Resolve<any>
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get('api/todo-tags')
|
||||
.subscribe((response: any) => {
|
||||
this.tags = response.data;
|
||||
this.tags = response;
|
||||
this.onTagsChanged.next(this.tags);
|
||||
resolve(this.tags);
|
||||
}, reject);
|
||||
@@ -145,7 +145,7 @@ export class TodoService implements Resolve<any>
|
||||
|
||||
this.http.get('api/todo-todos')
|
||||
.subscribe((todos: any) => {
|
||||
this.todos = todos.data.map(todo => {
|
||||
this.todos = todos.map(todo => {
|
||||
return new Todo(todo);
|
||||
});
|
||||
|
||||
@@ -178,7 +178,7 @@ export class TodoService implements Resolve<any>
|
||||
this.http.get('api/todo-todos?' + param)
|
||||
.subscribe((todos: any) => {
|
||||
|
||||
this.todos = todos.data.map(todo => {
|
||||
this.todos = todos.map(todo => {
|
||||
return new Todo(todo);
|
||||
});
|
||||
|
||||
@@ -203,12 +203,12 @@ export class TodoService implements Resolve<any>
|
||||
this.http.get('api/todo-tags?handle=' + handle)
|
||||
.subscribe((tags: any) => {
|
||||
|
||||
const tagId = tags.data[0].id;
|
||||
const tagId = tags[0].id;
|
||||
|
||||
this.http.get('api/todo-todos?tags=' + tagId)
|
||||
.subscribe((todos: any) => {
|
||||
|
||||
this.todos = todos.data.map(todo => {
|
||||
this.todos = todos.map(todo => {
|
||||
return new Todo(todo);
|
||||
});
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class InvoiceService implements Resolve<any>
|
||||
|
||||
this.http.get('api/invoice')
|
||||
.subscribe((timeline: any) => {
|
||||
this.invoice = timeline.data;
|
||||
this.invoice = timeline;
|
||||
this.invoiceOnChanged.next(this.invoice);
|
||||
resolve(this.invoice);
|
||||
}, reject);
|
||||
|
||||
@@ -50,7 +50,7 @@ export class ProfileService implements Resolve<any>
|
||||
|
||||
this.http.get('api/profile-timeline')
|
||||
.subscribe((timeline: any) => {
|
||||
this.timeline = timeline.data;
|
||||
this.timeline = timeline;
|
||||
this.timelineOnChanged.next(this.timeline);
|
||||
resolve(this.timeline);
|
||||
}, reject);
|
||||
@@ -66,7 +66,7 @@ export class ProfileService implements Resolve<any>
|
||||
|
||||
this.http.get('api/profile-about')
|
||||
.subscribe((about: any) => {
|
||||
this.about = about.data;
|
||||
this.about = about;
|
||||
this.aboutOnChanged.next(this.about);
|
||||
resolve(this.about);
|
||||
}, reject);
|
||||
@@ -82,7 +82,7 @@ export class ProfileService implements Resolve<any>
|
||||
|
||||
this.http.get('api/profile-photos-videos')
|
||||
.subscribe((photosVideos: any) => {
|
||||
this.photosVideos = photosVideos.data;
|
||||
this.photosVideos = photosVideos;
|
||||
this.photosVideosOnChanged.next(this.photosVideos);
|
||||
resolve(this.photosVideos);
|
||||
}, reject);
|
||||
|
||||
@@ -47,7 +47,7 @@ export class SearchService implements Resolve<any>
|
||||
|
||||
this.http.get('api/search-classic')
|
||||
.subscribe((classic: any) => {
|
||||
this.classic = classic.data;
|
||||
this.classic = classic;
|
||||
this.classicOnChanged.next(this.classic);
|
||||
resolve(this.classic);
|
||||
}, reject);
|
||||
@@ -63,7 +63,7 @@ export class SearchService implements Resolve<any>
|
||||
|
||||
this.http.get('api/search-table')
|
||||
.subscribe((table: any) => {
|
||||
this.table = table.data;
|
||||
this.table = table;
|
||||
this.tableOnChanged.next(this.table);
|
||||
resolve(this.table);
|
||||
}, reject);
|
||||
|
||||
Reference in New Issue
Block a user