feat: 4 new analytics modules
This commit is contained in:
1 parent
2890d9ccf0
commit
9cd8657ce6
10 files changed
+138
No files matched your search
@@ -177,6 +177,11 @@ module.exports = class Page extends Model {
|
||||
}
|
||||
|
||||
static async createPage(opts) {
|
||||
const dupCheck = await WIKI.models.pages.query().select('id').where('localeCode', opts.locale).where('path', opts.path).first()
|
||||
if (dupCheck) {
|
||||
throw new WIKI.Error.PageDuplicateCreate()
|
||||
}
|
||||
|
||||
await WIKI.models.pages.query().insert({
|
||||
authorId: opts.authorId,
|
||||
content: opts.content,
|
||||
|
||||
Reference in new issue
Block a user