1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

Fix broken mata id on updatePage action

This commit is contained in:
zinyando 2016-08-29 18:44:30 +02:00
parent a33232dea4
commit 6817f5083e
5 changed files with 10 additions and 9 deletions

View file

@ -112,7 +112,6 @@ export default Ember.Component.extend({
save() {
let user = this.get('editUser');
let password = this.get('password');
debugger;
if (is.empty(user.firstname)) {
$("#edit-firstname").addClass("error").focus();

View file

@ -11,13 +11,13 @@
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
// import { belongsTo, hasMany } from 'ember-data/relationships';
// import { belongsTo } from 'ember-data/relationships';
export default Model.extend({
pageId: attr('string'),
documentId: attr('string'),
orgId: attr('string'),
rawBody: attr('string'),
rawBody: attr(),
config: attr(),
externalSource: attr('boolean', { defaultValue: false }),
created: attr(),

View file

@ -12,7 +12,7 @@
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
// import { belongsTo, hasMany } from 'ember-data/relationships';
// import { hasMany } from 'ember-data/relationships';
export default Model.extend({
documentId: attr('string'),
@ -25,6 +25,7 @@ export default Model.extend({
body: attr('string'),
rawBody: attr('string'),
meta: attr(),
// meta: hasMany('page-meta'),
tagName: Ember.computed('level', function () {
return "h" + this.get('level');

View file

@ -1,11 +1,11 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
// by contacting <sales@documize.com>.
//
// https://documize.com
@ -29,8 +29,8 @@ export default Ember.Controller.extend(NotifierMixin, {
this.showNotification("Saving");
let model = {
page: page,
meta: meta
page: page.toJSON({ includeId: true }),
meta: meta.toJSON({ includeId: true })
};
this.get('documentService').updatePage(page.get('documentId'), page.get('id'), model).then(function () {
@ -43,4 +43,4 @@ export default Ember.Controller.extend(NotifierMixin, {
});
}
}
});
});

View file

@ -124,6 +124,7 @@ 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',