feat: rebuild page tree worker

This commit is contained in:
NGPixel
2019-10-07 00:06:47 -04:00
parent 2883437a0f
commit 38c33c58bb
10 changed files with 198 additions and 119 deletions

View File

@@ -180,6 +180,17 @@ module.exports = class Storage extends Model {
}
}
static async assetEvent({ event, asset }) {
try {
for (let target of this.targets) {
await target.fn[`asset${_.capitalize(event)}`](asset)
}
} catch (err) {
WIKI.logger.warn(err)
throw err
}
}
static async executeAction(targetKey, handler) {
try {
const target = _.find(this.targets, ['key', targetKey])