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>>();
|
const [searchResults, setSearchResults] = useState<Array<SearchResult | undefined>>();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
search(searchTerm, server.jellyfinServerID).then(results => {
|
search(searchTerm, server.url).then(results => {
|
||||||
setSearchResults(results);
|
setSearchResults(results);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
setSearchResults([]);
|
setSearchResults([]);
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ export interface SearchResult {
|
||||||
productionYear: string;
|
productionYear: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const search = async (searchTerm: string, serverId: string): Promise<Array<SearchResult>> => {
|
export const search = async (searchTerm: string, serverUrl: string): Promise<Array<SearchResult>> => {
|
||||||
const response = await axios.get<Array<SearchResult>>(encodeURI(`${apiUrl}/search?searchTerm=${searchTerm}&serverUrl=${serverId}`), { withCredentials: true });
|
const response = await axios.get<Array<SearchResult>>(encodeURI(`${apiUrl}/search?searchTerm=${searchTerm}&serverUrl=${serverUrl}`), { withCredentials: true });
|
||||||
|
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue