|
|
@ -477,7 +477,7 @@ export class Page extends Model {
|
|
|
|
throw new Error('ERR_PAGE_ALIAS_TOO_LONG')
|
|
|
|
throw new Error('ERR_PAGE_ALIAS_TOO_LONG')
|
|
|
|
} else if (!aliasRegex.test(patch.alias)) {
|
|
|
|
} else if (!aliasRegex.test(patch.alias)) {
|
|
|
|
throw new Error('ERR_PAGE_INVALID_ALIAS')
|
|
|
|
throw new Error('ERR_PAGE_INVALID_ALIAS')
|
|
|
|
}
|
|
|
|
} else if (patch.alias.length > 0) {
|
|
|
|
const dupAliasCheck = await WIKI.db.pages.query().where({
|
|
|
|
const dupAliasCheck = await WIKI.db.pages.query().where({
|
|
|
|
siteId: ogPage.siteId,
|
|
|
|
siteId: ogPage.siteId,
|
|
|
|
alias: patch.alias
|
|
|
|
alias: patch.alias
|
|
|
@ -486,6 +486,7 @@ export class Page extends Model {
|
|
|
|
throw new Error('ERR_PAGE_DUPLICATE_ALIAS')
|
|
|
|
throw new Error('ERR_PAGE_DUPLICATE_ALIAS')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ('content' in opts.patch) {
|
|
|
|
if ('content' in opts.patch) {
|
|
|
|
patch.content = opts.patch.content
|
|
|
|
patch.content = opts.patch.content
|
|
|
|