fixed incorrect variable passed to search
This commit is contained in:
parent
9f6c40c54e
commit
7e0e492fca
2 changed files with 3 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ const ServerSearch = ({ searchTerm, server }: ServerSearchProps) => {
|
|||
const [searchResults, setSearchResults] = useState<Array<SearchResult | undefined>>();
|
||||
|
||||
useEffect(() => {
|
||||
search(searchTerm, server.jellyfinServerID).then(results => {
|
||||
search(searchTerm, server.url).then(results => {
|
||||
setSearchResults(results);
|
||||
}).catch(err => {
|
||||
setSearchResults([]);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ export interface SearchResult {
|
|||
productionYear: string;
|
||||
}
|
||||
|
||||
export const search = async (searchTerm: string, serverId: string): Promise<Array<SearchResult>> => {
|
||||
const response = await axios.get<Array<SearchResult>>(encodeURI(`${apiUrl}/search?searchTerm=${searchTerm}&serverUrl=${serverId}`), { withCredentials: true });
|
||||
export const search = async (searchTerm: string, serverUrl: string): Promise<Array<SearchResult>> => {
|
||||
const response = await axios.get<Array<SearchResult>>(encodeURI(`${apiUrl}/search?searchTerm=${searchTerm}&serverUrl=${serverUrl}`), { withCredentials: true });
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue