feat: page locale migration + deps update

This commit is contained in:
Nick
2019-07-14 16:12:26 -04:00
parent 35c09a3602
commit 5689444a17
11 changed files with 735 additions and 892 deletions

View File

@@ -98,9 +98,10 @@ module.exports = {
},
async migrateToLocale(obj, args, context) {
try {
const count = await WIKI.models.pages.migrateToLocale(args)
return {
responseResult: graphHelper.generateSuccess('Migrated all content to target locale successfully.')
responseResult: graphHelper.generateSuccess('Migrated content to target locale successfully.'),
count
}
} catch (err) {
return graphHelper.generateError(err)

View File

@@ -77,7 +77,7 @@ type PageMutation {
migrateToLocale(
sourceLocale: String!
targetLocale: String!
): DefaultResponse @auth(requires: ["manage:system"])
): PageMigrationResponse @auth(requires: ["manage:system"])
}
# -----------------------------------------------
@@ -89,6 +89,11 @@ type PageResponse {
page: Page
}
type PageMigrationResponse {
responseResult: ResponseStatus!
count: Int
}
type Page {
id: Int!
path: String!