feat: save page + create event for storage targets

This commit is contained in:
NGPixel
2018-07-22 16:25:39 -04:00
parent cb84df7a53
commit 076e923d48
22 changed files with 158 additions and 89 deletions

View File

@@ -86,4 +86,19 @@ module.exports = class Storage extends Model {
WIKI.logger.error(err)
}
}
static async createPage(page) {
const targets = await WIKI.db.storage.query().where('isEnabled', true)
if (targets && targets.length > 0) {
_.forEach(targets, target => {
WIKI.queue.job.syncStorage.add({
event: 'created',
target,
page
}, {
removeOnComplete: true
})
})
}
}
}