| @@ -9,6 +9,7 @@ import EditNote from "@mui/icons-material/EditNote"; | |||||
| import uniq from "lodash/uniq"; | import uniq from "lodash/uniq"; | ||||
| import { useRouter } from "next/navigation"; | import { useRouter } from "next/navigation"; | ||||
| import { MAINTAIN_PROJECT } from "@/middleware"; | import { MAINTAIN_PROJECT } from "@/middleware"; | ||||
| import { uniqBy } from "lodash"; | |||||
| interface Props { | interface Props { | ||||
| projects: ProjectResult[]; | projects: ProjectResult[]; | ||||
| @@ -20,7 +21,6 @@ type SearchQuery = Partial<Omit<ProjectResult, "id">>; | |||||
| type SearchParamNames = keyof SearchQuery; | type SearchParamNames = keyof SearchQuery; | ||||
| const ProjectSearch: React.FC<Props> = ({ projects, projectCategories, abilities }) => { | const ProjectSearch: React.FC<Props> = ({ projects, projectCategories, abilities }) => { | ||||
| console.log(projects) | |||||
| const router = useRouter(); | const router = useRouter(); | ||||
| const { t } = useTranslation("projects"); | const { t } = useTranslation("projects"); | ||||
| @@ -34,7 +34,7 @@ const ProjectSearch: React.FC<Props> = ({ projects, projectCategories, abilities | |||||
| label: t("Client name"), | label: t("Client name"), | ||||
| paramName: "client", | paramName: "client", | ||||
| type: "autocomplete", | 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"), | label: t("Project category"), | ||||