diff --git a/src/api/getUserSearch.ts b/src/api/getUserSearch.ts index 32d9311..558fc26 100644 --- a/src/api/getUserSearch.ts +++ b/src/api/getUserSearch.ts @@ -1,8 +1,7 @@ import { client } from "./client"; -import type { PersonRef, Role } from "./types"; +import type { PersonRef } from "./types"; -export function getUserSearch(query: string, role?: Role, signal?: AbortSignal): Promise { +export function getUserSearch(query: string, signal?: AbortSignal): Promise { const params = new URLSearchParams({ q: query }); - if (role) params.set("role", role); return client(`/users/search?${params.toString()}`, { signal }); } diff --git a/src/components/users/user-search-select.tsx b/src/components/users/user-search-select.tsx index 4f8e333..636436f 100644 --- a/src/components/users/user-search-select.tsx +++ b/src/components/users/user-search-select.tsx @@ -1,6 +1,5 @@ import { For, Show, createMemo, createResource, createSignal } from "solid-js"; import { getUserSearch } from "@/api/getUserSearch"; -import type { Role } from "@/api/types"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select } from "@/components/ui/select"; @@ -12,7 +11,6 @@ export function UserSearchSelect(props: { value: string; onChange: (value: string) => void; label?: string; - role?: Role; excludeIds?: string[]; placeholder?: string; disabled?: boolean; @@ -23,11 +21,11 @@ export function UserSearchSelect(props: { const search = createMemo(() => { const q = query().trim(); if (q.length < 2) return null; - return { q, role: props.role }; + return q; }); const [users] = createResource(search, async (source) => { if (!source) return []; - return getUserSearch(source.q, source.role); + return getUserSearch(source); }); const options = createMemo(() => { const excluded = new Set(props.excludeIds ?? []); diff --git a/src/pages/course-detail-page.tsx b/src/pages/course-detail-page.tsx index 4258c51..a244a5f 100644 --- a/src/pages/course-detail-page.tsx +++ b/src/pages/course-detail-page.tsx @@ -394,7 +394,6 @@ function CourseDetailContent() {