Filter groups given a member (#5034)
* feat: filter groups given a member * Revert "feat: filter groups given a member" This reverts commit 7dac8bb38de1fdaf661c636c5d1b13e4112fd8fd. * fix: make it work via db query
This commit is contained in:
@@ -23,10 +23,10 @@ router.post(
|
||||
pagination(),
|
||||
validate(T.GroupsListSchema),
|
||||
async (ctx: APIContext<T.GroupsListReq>) => {
|
||||
const { direction, sort } = ctx.input.body;
|
||||
const { direction, sort, userId } = ctx.input.body;
|
||||
const { user } = ctx.state.auth;
|
||||
|
||||
const groups = await Group.findAll({
|
||||
const groups = await Group.filterByMember(userId).findAll({
|
||||
where: {
|
||||
teamId: user.teamId,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user