|
|
@ -79,6 +79,8 @@ export default class Book {
|
|
|
|
switch (task) {
|
|
|
|
switch (task) {
|
|
|
|
case DataEvent.API_PAGE_CREATE:
|
|
|
|
case DataEvent.API_PAGE_CREATE:
|
|
|
|
case DataEvent.API_PAGE_WRITE:
|
|
|
|
case DataEvent.API_PAGE_WRITE:
|
|
|
|
|
|
|
|
var layout = 'page';
|
|
|
|
|
|
|
|
if (body.layout !== 'page') layout = body.layout;
|
|
|
|
var pageWrite =
|
|
|
|
var pageWrite =
|
|
|
|
'---\n' +
|
|
|
|
'---\n' +
|
|
|
|
'id: ' +
|
|
|
|
'id: ' +
|
|
|
@ -94,7 +96,7 @@ export default class Book {
|
|
|
|
body.feature +
|
|
|
|
body.feature +
|
|
|
|
'\n' +
|
|
|
|
'\n' +
|
|
|
|
'layout: ' +
|
|
|
|
'layout: ' +
|
|
|
|
'page' +
|
|
|
|
layout +
|
|
|
|
'\n' +
|
|
|
|
'\n' +
|
|
|
|
'tags: ' +
|
|
|
|
'tags: ' +
|
|
|
|
body.tags +
|
|
|
|
body.tags +
|
|
|
@ -139,8 +141,9 @@ export default class Book {
|
|
|
|
response = {
|
|
|
|
response = {
|
|
|
|
type: DataEvent.PAGE_ADDED,
|
|
|
|
type: DataEvent.PAGE_ADDED,
|
|
|
|
message: 'New Page Created',
|
|
|
|
message: 'New Page Created',
|
|
|
|
id: body.page_uuid
|
|
|
|
id: body.uuid
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
resolve(response);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
response = {
|
|
|
|
response = {
|
|
|
|
type: DataEvent.PAGE_UPDATED,
|
|
|
|
type: DataEvent.PAGE_UPDATED,
|
|
|
@ -210,8 +213,7 @@ export default class Book {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tags = _.orderBy(tags, ['tag_name'], ['asc']);
|
|
|
|
tags = _.orderBy(tags, ['tag_name'], ['asc']);
|
|
|
|
settings.saveTags(tags).then(response => {
|
|
|
|
settings.saveTags(tags).then(() => {
|
|
|
|
console.log('RESPONSE', response);
|
|
|
|
|
|
|
|
render
|
|
|
|
render
|
|
|
|
.publishTags(pages)
|
|
|
|
.publishTags(pages)
|
|
|
|
.then(response => {
|
|
|
|
.then(response => {
|
|
|
|