seepur/app/Models/Call.js

19 lines
359 B
JavaScript
Raw Normal View History

2020-04-12 14:25:42 +00:00
'use strict'
/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */
const Model = use('Model')
2020-04-14 15:06:09 +00:00
const User = use('App/Models/User');
2020-04-12 14:25:42 +00:00
class Call extends Model {
2020-04-14 15:06:09 +00:00
async getUsers() {
const users = [
(await User.find(this.user_1)).toJSON(),
(await User.find(this.user_2)).toJSON()
];
return users;
}
2020-04-12 14:25:42 +00:00
}
module.exports = Call