mirror of
https://github.com/documize/community.git
synced 2025-07-25 16:19:46 +02:00
Fix broken mata id on updatePage action
This commit is contained in:
parent
a33232dea4
commit
6817f5083e
5 changed files with 10 additions and 9 deletions
|
@ -112,7 +112,6 @@ export default Ember.Component.extend({
|
||||||
save() {
|
save() {
|
||||||
let user = this.get('editUser');
|
let user = this.get('editUser');
|
||||||
let password = this.get('password');
|
let password = this.get('password');
|
||||||
debugger;
|
|
||||||
|
|
||||||
if (is.empty(user.firstname)) {
|
if (is.empty(user.firstname)) {
|
||||||
$("#edit-firstname").addClass("error").focus();
|
$("#edit-firstname").addClass("error").focus();
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
|
|
||||||
import Model from 'ember-data/model';
|
import Model from 'ember-data/model';
|
||||||
import attr from 'ember-data/attr';
|
import attr from 'ember-data/attr';
|
||||||
// import { belongsTo, hasMany } from 'ember-data/relationships';
|
// import { belongsTo } from 'ember-data/relationships';
|
||||||
|
|
||||||
export default Model.extend({
|
export default Model.extend({
|
||||||
pageId: attr('string'),
|
pageId: attr('string'),
|
||||||
documentId: attr('string'),
|
documentId: attr('string'),
|
||||||
orgId: attr('string'),
|
orgId: attr('string'),
|
||||||
rawBody: attr('string'),
|
rawBody: attr(),
|
||||||
config: attr(),
|
config: attr(),
|
||||||
externalSource: attr('boolean', { defaultValue: false }),
|
externalSource: attr('boolean', { defaultValue: false }),
|
||||||
created: attr(),
|
created: attr(),
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
import Model from 'ember-data/model';
|
import Model from 'ember-data/model';
|
||||||
import attr from 'ember-data/attr';
|
import attr from 'ember-data/attr';
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
// import { belongsTo, hasMany } from 'ember-data/relationships';
|
// import { hasMany } from 'ember-data/relationships';
|
||||||
|
|
||||||
export default Model.extend({
|
export default Model.extend({
|
||||||
documentId: attr('string'),
|
documentId: attr('string'),
|
||||||
|
@ -25,6 +25,7 @@ export default Model.extend({
|
||||||
body: attr('string'),
|
body: attr('string'),
|
||||||
rawBody: attr('string'),
|
rawBody: attr('string'),
|
||||||
meta: attr(),
|
meta: attr(),
|
||||||
|
// meta: hasMany('page-meta'),
|
||||||
|
|
||||||
tagName: Ember.computed('level', function () {
|
tagName: Ember.computed('level', function () {
|
||||||
return "h" + this.get('level');
|
return "h" + this.get('level');
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
// 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
|
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
//
|
//
|
||||||
// You can operate outside the AGPL restrictions by purchasing
|
// You can operate outside the AGPL restrictions by purchasing
|
||||||
// Documize Enterprise Edition and obtaining a commercial license
|
// Documize Enterprise Edition and obtaining a commercial license
|
||||||
// by contacting <sales@documize.com>.
|
// by contacting <sales@documize.com>.
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
this.showNotification("Saving");
|
this.showNotification("Saving");
|
||||||
|
|
||||||
let model = {
|
let model = {
|
||||||
page: page,
|
page: page.toJSON({ includeId: true }),
|
||||||
meta: meta
|
meta: meta.toJSON({ includeId: true })
|
||||||
};
|
};
|
||||||
|
|
||||||
this.get('documentService').updatePage(page.get('documentId'), page.get('id'), model).then(function () {
|
this.get('documentService').updatePage(page.get('documentId'), page.get('id'), model).then(function () {
|
||||||
|
@ -43,4 +43,4 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -124,6 +124,7 @@ export default Ember.Service.extend({
|
||||||
updatePage: function (documentId, pageId, payload, skipRevision) {
|
updatePage: function (documentId, pageId, payload, skipRevision) {
|
||||||
var revision = skipRevision ? "?r=true" : "?r=false";
|
var revision = skipRevision ? "?r=true" : "?r=false";
|
||||||
let url = `documents/${documentId}/pages/${pageId}${revision}`;
|
let url = `documents/${documentId}/pages/${pageId}${revision}`;
|
||||||
|
Ember.set(payload.meta, 'id', parseInt(payload.meta.id));
|
||||||
|
|
||||||
return this.get('ajax').request(url, {
|
return this.get('ajax').request(url, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue