mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
tab edit mode
This commit is contained in:
parent
3965f6e94c
commit
9fe115a9bd
13 changed files with 126 additions and 106 deletions
|
@ -124,12 +124,16 @@ export default Ember.Service.extend({
|
|||
updatePage: function (documentId, pageId, payload, skipRevision) {
|
||||
var revision = skipRevision ? "?r=true" : "?r=false";
|
||||
let url = `documents/${documentId}/pages/${pageId}${revision}`;
|
||||
|
||||
Ember.set(payload.meta, 'id', parseInt(payload.meta.id));
|
||||
|
||||
return this.get('ajax').request(url, {
|
||||
method: 'PUT',
|
||||
data: JSON.stringify(payload),
|
||||
contentType: 'json'
|
||||
}).then((response) => {
|
||||
let data = this.get('store').normalize('page', response);
|
||||
return this.get('store').push(data);
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -140,6 +144,9 @@ export default Ember.Service.extend({
|
|||
return this.get('ajax').post(url, {
|
||||
data: JSON.stringify(payload),
|
||||
contentType: 'json'
|
||||
}).then((response) => {
|
||||
let data = this.get('store').normalize('page', response);
|
||||
return this.get('store').push(data);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue