Add logic for saving draft picks to team and fetching draft & team from server for frontend

This commit is contained in:
2020-11-05 21:53:35 -06:00
parent fc5b90a938
commit a207cd0a11
6 changed files with 102 additions and 4 deletions

View File

@@ -6,6 +6,10 @@ const AuthUser = require('flitter-auth/model/User')
* properties here as you need.
*/
class User extends AuthUser {
static get services() {
return [...super.services, 'models']
}
static get schema() {
return {...super.schema, ...{
// other schema fields here
@@ -13,6 +17,10 @@ class User extends AuthUser {
}
// Other members and methods here
async team() {
const Team = this.models.get('Team')
return Team.getForUser(this)
}
}
module.exports = exports = User