Skip to content
Discussion options

You must be logged in to vote

I've found a simple and clever workaround for this issue on this comment.

Basically, aliasing this does the trick.

public async getRoles () {
  const user: User = this

  return await user.related('roles').query()
}

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
2 replies
@rrmesquita
Comment options

@Reptiluka
Comment options

Comment options

You must be logged in to vote
2 replies
@thetutlage
Comment options

@eliferd
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@motvicka
Comment options

@rodrigorz
Comment options

@rrmesquita
Comment options

@inghggw
Comment options

Answer selected by rrmesquita
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
8 participants