Unverified Commit e4efb38f authored by NGPixel's avatar NGPixel

fix: empty duplicate alias warning on page udpate

parent 1522b269
......@@ -477,7 +477,7 @@ export class Page extends Model {
throw new Error('ERR_PAGE_ALIAS_TOO_LONG')
} else if (!aliasRegex.test(patch.alias)) {
throw new Error('ERR_PAGE_INVALID_ALIAS')
}
} else if (patch.alias.length > 0) {
const dupAliasCheck = await WIKI.db.pages.query().where({
siteId: ogPage.siteId,
alias: patch.alias
......@@ -486,6 +486,7 @@ export class Page extends Model {
throw new Error('ERR_PAGE_DUPLICATE_ALIAS')
}
}
}
if ('content' in opts.patch) {
patch.content = opts.patch.content
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment