feat: image upload + list root assets (wip)

This commit is contained in:
Nick
2019-05-13 01:15:27 -04:00
parent 89c07a716a
commit 6b886b6e3f
23 changed files with 526 additions and 171 deletions

View File

@@ -0,0 +1,35 @@
/* global WIKI */
const Model = require('objection').Model
/**
* Users model
*/
module.exports = class AssetFolder extends Model {
static get tableName() { return 'assetFolders' }
static get jsonSchema () {
return {
type: 'object',
properties: {
id: {type: 'integer'},
name: {type: 'string'},
slug: {type: 'string'}
}
}
}
static get relationMappings() {
return {
parent: {
relation: Model.BelongsToOneRelation,
modelClass: AssetFolder,
join: {
from: 'assetFolders.folderId',
to: 'assetFolders.id'
}
}
}
}
}