-
Hello all, First of all thanks to this awesome project, I really like the static type checking! I've understood that the property Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
A known issue with Typescript directly. I have already reported it microsoft/TypeScript#37778 |
Beta Was this translation helpful? Give feedback.
-
Wow, I didn't expect that. I've seen you pinged the issue, thanks 👍 For anyone who had the same problem, I've used this workaround to trick Typescript: public static async isAdmin(user: User) {
const roles = await user.related('roles').query().select('name')
return roles.some((role) => role.name == 'admin')
}
public async isAdmin() {
return await User.isAdmin(this)
} |
Beta Was this translation helpful? Give feedback.
Wow, I didn't expect that. I've seen you pinged the issue, thanks 👍
For anyone who had the same problem, I've used this workaround to trick Typescript: