This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
seepur/app/Models/ActivityLog.js

20 lines
429 B
JavaScript

'use strict'
/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */
const Model = use('Model')
class ActivityLog extends Model {
async call() {
return this.belongsTo('App/Models/Call');
}
async resource() {
switch (this.type) {
case 'BOOK':
return this.belongsTo('App/Models/Book');
default:
throw new Error('Unknown Resource Type');
}
}
}
module.exports = ActivityLog