Skip to content

Commit

Permalink
Add queried categories to the allCategories data
Browse files Browse the repository at this point in the history
Close #12
  • Loading branch information
nonylene committed Feb 11, 2024
1 parent ec4f58e commit 0d994a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/routes/search.mail/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ const createSearchBox = (
allCategories: string[],
) => {
const { query, order, advanced, categories } = parseSearchParams(params);
const types = allCategories.map((v) => {
const extraCategories = (categories ?? []).filter(
(v) => !allCategories.includes(v),
);
const types = [...extraCategories, ...allCategories].map((v) => {
return { value: v, label: v };
});
return (
Expand Down

0 comments on commit 0d994a1

Please sign in to comment.