feat(admin): added backend for admin pages

This commit is contained in:
Fishandchips321 2026-03-05 17:19:24 +00:00
parent 54cfc05b88
commit 56ea7fb7f0
26 changed files with 662 additions and 42 deletions

View file

@ -13,7 +13,7 @@ const ServerSearch = ({ searchTerm, server }: ServerSearchProps) => {
const [searchResults, setSearchResults] = useState<Array<SearchResult | undefined>>();
useEffect(() => {
search(searchTerm, server.id).then(results => {
search(searchTerm, server.jellyfinServerID).then(results => {
setSearchResults(results);
}).catch(err => {
setSearchResults([]);

View file

@ -7,7 +7,7 @@ export interface Session {
}
export const logIn = async (username: string, password: string) => {
const response = await axios.post<Session>(`${apiUrl}/auth`, `username=${encodeURI(username)}&password=${encodeURI(password)}`);
const response = await axios.post<Session>(`${apiUrl}/auth/login`, `username=${encodeURI(username)}&password=${encodeURI(password)}`);
return response.data;
}

View file

@ -3,7 +3,8 @@ import { apiUrl } from "./api";
export interface Server {
name?: string;
id: string;
id: number;
jellyfinServerID: string;
errored: boolean;
owner: string;
url: string;
@ -11,7 +12,7 @@ export interface Server {
export const getServerList = async (): Promise<Array<Server>> => {
console.log("fetching server list");
const response = await axios.get<Array<Server>>(`${apiUrl}/servers`, { withCredentials: true });
const response = await axios.get<Array<Server>>(`${apiUrl}/servers/all`, { withCredentials: true });
console.log(response);