feat: pages admin + path parsing fixes
This commit is contained in:
@@ -42,6 +42,18 @@ module.exports = {
|
||||
'createdAt',
|
||||
'updatedAt'
|
||||
])
|
||||
},
|
||||
async single (obj, args, context, info) {
|
||||
let page = await WIKI.models.pages.getPageFromDb(args.id)
|
||||
if (page) {
|
||||
return {
|
||||
...page,
|
||||
locale: page.localeCode,
|
||||
editor: page.editorKey
|
||||
}
|
||||
} else {
|
||||
throw new WIKI.Error.PageNotFound()
|
||||
}
|
||||
}
|
||||
},
|
||||
PageMutation: {
|
||||
|
@@ -28,6 +28,10 @@ type PageQuery {
|
||||
): PageSearchResponse! @auth(requires: ["manage:system", "read:pages"])
|
||||
|
||||
list: [PageListItem!]! @auth(requires: ["manage:system"])
|
||||
|
||||
single(
|
||||
id: Int!
|
||||
): Page @auth(requires: ["manage:pages", "delete:pages", "manage:system"])
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
@@ -80,6 +84,29 @@ type PageResponse {
|
||||
|
||||
type Page {
|
||||
id: Int!
|
||||
path: String!
|
||||
hash: String!
|
||||
title: String!
|
||||
description: String!
|
||||
isPrivate: Boolean!
|
||||
isPublished: Boolean!
|
||||
privateNS: String
|
||||
publishStartDate: Date!
|
||||
publishEndDate: String!
|
||||
content: String!
|
||||
render: String
|
||||
toc: String
|
||||
contentType: String!
|
||||
createdAt: Date!
|
||||
updatedAt: Date!
|
||||
editor: String!
|
||||
locale: String!
|
||||
authorId: Int!
|
||||
authorName: String!
|
||||
authorEmail: String!
|
||||
creatorId: Int!
|
||||
creatorName: String!
|
||||
creatorEmail: String!
|
||||
}
|
||||
|
||||
type PageHistory {
|
||||
|
Reference in New Issue
Block a user