feat: save page + create event for storage targets

This commit is contained in:
NGPixel
2018-07-22 16:25:39 -04:00
parent cb84df7a53
commit 076e923d48
22 changed files with 158 additions and 89 deletions

View File

@@ -22,16 +22,9 @@ module.exports = {
},
PageMutation: {
async create(obj, args, context) {
const page = await WIKI.db.pages.query().insertAndFetch({
path: args.path,
title: args.title,
description: args.description,
const page = await WIKI.db.pages.createPage({
...args,
isPrivate: false,
isPublished: args.isPublished,
publishStartDate: args.publishStartDate,
publishEndDate: args.publishEndDate,
localeCode: args.locale,
editorKey: args.editor,
authorId: context.req.user.id
})
return {

View File

@@ -34,20 +34,22 @@ type PageQuery {
type PageMutation {
create(
description: String
editor: String
content: String!
description: String!
editor: String!
isPublished: Boolean!
isPrivate: Boolean
isPrivate: Boolean!
locale: String!
path: String!
publishEndDate: Date
publishStartDate: Date
tags: [String]
tags: [String]!
title: String!
): PageResponse
update(
id: Int!
content: String
description: String
editor: String
isPublished: Boolean