Filter join request to return only data of current user
See original GitHub issueCurrently I got his in my Controller:
@Crud({
model: {
type: Broker
},
query: {
join: {
user: {
eager: true,
exclude: ['password']
}
}
}
})
@Controller('broker')
@UseGuards(AuthGuard('jwt'))
export class BrokerController {
constructor(public service: BrokerService) {}
}
There is a one to many relation between user and broker. I am authenticating the users by a jwt token and I need to filter the data on the id of the user. Is there any way to do this through the Crud configuration?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Nestjs Crud: Filter join request to return only data of current user
I am authenticating the users by a jwt token and I need to filter the data on the id of the user. Is...
Read more >How to filter 'Assigned To' to the current user - ServiceNow
Hi All,. I'm currently running into some difficulties and would appreciate some insight. I created a new module that returns.
Read more >Rest API - SOQL Query : Want to get Only Current user's Record
I do not know how to get User ID for filtering. I have tried like this : "SELECT Id FROM User Where Id=CreatedById"....
Read more >Filter by status and by current user - Power Platform Community
I only want the user to view their own items submitted and their item status. Currently i have for each gallery to filter...
Read more >3 Ways To Filter A Power Apps Gallery By The Current User
There are many ways to do it. The easiest way is to get the current user's email and use a filter function to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@chriszrc working on something similar that will be built in the lib
The interceptor is probably the way to go, but I overrode the getMany method for my initial solution, it does the same thing:
the @PrincipalUser annotation is just sugar for extracting the req.user:
@loginov-rocks I think the way you’re setting filter, you would override any existing filters that were supplied in the request? Probably not what most people want-