feat: implement season requests management with CRUD operations and enhance UI components

This commit is contained in:
maxDorninger
2025-05-24 14:24:00 +02:00
parent f2b7f0f370
commit d2f0b8f22d
15 changed files with 253 additions and 71 deletions

View File

@@ -1,5 +1,10 @@
import {type ClassValue, clsx} from 'clsx';
import {twMerge} from 'tailwind-merge';
import {env} from "$env/dynamic/public";
import {goto} from '$app/navigation';
import {base} from '$app/paths';
const apiUrl = env.PUBLIC_API_URL;
export const qualityMap: { [key: number]: string } = {
1: 'high',
@@ -42,4 +47,17 @@ export function convertTorrentSeasonRangeToIntegerRange(torrent: any): string {
return "Error parsing season range: " + torrent.seasons;
}
}
export async function handleLogout(): null {
const response = await fetch(apiUrl + '/auth/cookie/logout', {
method: 'POST',
credentials: 'include'
});
if (response.ok) {
console.log('Logout successful!');
await goto(base + '/login');
} else {
console.error('Logout failed:', response.status);
}
}