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

upgraded Ember and Bootstrap, merged changes

This commit is contained in:
sauls8t 2018-01-22 10:31:03 +00:00
parent b4fd42da38
commit 5dd7d9c181
114 changed files with 9814 additions and 1361 deletions

View file

@ -12,33 +12,15 @@
import Service, { inject as service } from '@ember/service';
export default Service.extend({
sessionService: service('session'),
ajax: service(),
store: service(),
// document number of views, edits, approvals, etc.
getDocumentSummary(documentId, days) {
return this.get('ajax').request(`activity/document/${documentId}?days=${days}`, {
getDocumentSummary(documentId) {
return this.get('ajax').request(`activity/document/${documentId}`, {
method: "GET"
}).then((response) => {
let data = {
viewers: [],
changers: []
};
data.viewers = response.viewers.map((obj) => {
let data = this.get('store').normalize('documentActivity', obj);
return this.get('store').push(data);
});
data.changers = response.changers.map((obj) => {
let data = this.get('store').normalize('documentActivity', obj);
return this.get('store').push(data);
});
return data;
return response;
}).catch(() => {
return [];
});
},
}
});