Skip to content

Commit

Permalink
use in query
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-justin committed Jan 11, 2024
1 parent cc65756 commit 3827f69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/Marketplace/ActiveFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
setKYCOnly,
setSDGgroups,
} from "slices/components/marketFilter";
import { categories, unsdgs } from "constants/unsdgs";
import { categories } from "constants/unsdgs";

export default function ActiveFilters() {
const { endow_designation, sdgGroups, countries, kyc_only } = useGetter(
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Marketplace/Cards/useCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import {
} from "services/aws/aws";
import { useGetter, useSetter } from "store/accessors";
import { isEmpty } from "helpers";
import { categories } from "constants/unsdgs";

export default function useCards() {
const dispatch = useSetter();
const { sort, searchText, ...params } = useGetter(
const { sort, searchText, sdgGroups, ...params } = useGetter(
(state) => state.component.marketFilter
);

const sdgs = sdgGroups.flatMap((g) => categories[g].sdgs);

const _params = Object.entries(params).reduce(
(prev, [key, val]) => ({
...prev,
Expand All @@ -27,6 +30,7 @@ export default function useCards() {
page: 1, // always starts at page 1
hits: 15,
published: "true",
sdgs: sdgs.join(","),
..._params,
});

Expand Down

0 comments on commit 3827f69

Please sign in to comment.