From 4e1c14990c03ff9bfa671f29a24ff9f528851056 Mon Sep 17 00:00:00 2001 From: "MSI\\derek" Date: Fri, 2 Aug 2024 17:04:50 +0800 Subject: [PATCH] update --- src/components/ProjectSearch/ProjectSearch.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ProjectSearch/ProjectSearch.tsx b/src/components/ProjectSearch/ProjectSearch.tsx index e2b4982..bedce36 100644 --- a/src/components/ProjectSearch/ProjectSearch.tsx +++ b/src/components/ProjectSearch/ProjectSearch.tsx @@ -9,6 +9,7 @@ import EditNote from "@mui/icons-material/EditNote"; import uniq from "lodash/uniq"; import { useRouter } from "next/navigation"; import { MAINTAIN_PROJECT } from "@/middleware"; +import { uniqBy } from "lodash"; interface Props { projects: ProjectResult[]; @@ -20,7 +21,6 @@ type SearchQuery = Partial>; type SearchParamNames = keyof SearchQuery; const ProjectSearch: React.FC = ({ projects, projectCategories, abilities }) => { - console.log(projects) const router = useRouter(); const { t } = useTranslation("projects"); @@ -34,7 +34,7 @@ const ProjectSearch: React.FC = ({ projects, projectCategories, abilities label: t("Client name"), paramName: "client", type: "autocomplete", - options: uniq(projects.map((project) => ({value: project.client, label: project.client}))), + options: uniqBy(projects.map((project) => ({value: project.client, label: project.client})), "value"), }, { label: t("Project category"),