Skip to content

Commit

Permalink
add 'slices' in filter when dynamic groups of groups
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Jul 2, 2024
1 parent ca249a0 commit 03ee885
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/packages/state/src/recoil/dynamicGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const dynamicGroupPageSelector = selectorFamily<
after: string | null;
count: number;
dataset: string;
filter: { group: { slice?: string } };
filter: { group: { slice?: string; slices?: string[] } };
view: State.Stage[];
},
{ modal: boolean; value: string }
Expand All @@ -84,12 +84,18 @@ export const dynamicGroupPageSelector = selectorFamily<
get:
({ modal, value }) =>
({ get }) => {
const slice = get(modal ? modalGroupSlice : groupSlice);

const params = {
dataset: get(datasetName),
view: get(dynamicGroupViewQuery(value)),
filter: { group: { slice: get(modal ? modalGroupSlice : groupSlice) } },
filter: { group: { slice } },
};

if (get(hasGroupSlices)) {
params.filter.group.slices = [slice];
}

return (cursor: number, pageSize: number) => ({
...params,
after: cursor ? String(cursor) : null,
Expand Down

0 comments on commit 03ee885

Please sign in to comment.