Implemented the new react version of the frontend

This commit is contained in:
Mohammed Abad committed 2026-03-31 01:56:38 +01:00
1 parent 236e6e06fb
commit ffe7e52527
65 files changed
+5228 -177

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { api } from '@/lib/api';
import type { Season } from '@/types';
export const seasonsApi = {
getAll: () => api.get<Season[]>('/seasons').then((r) => r.data),
getById: (id: number) =>
api.get<Season>(`/seasons/${id}`).then((r) => r.data),
getEpisodes: (id: number) =>
api.get(`/seasons/${id}/episodes`).then((r) => r.data),
create: (data: Partial<Season>) =>
api.post<Season>('/seasons', data).then((r) => r.data),
update: (id: number, data: Partial<Season>) =>
api.put<Season>(`/seasons/${id}`, data).then((r) => r.data),
delete: (id: number) => api.delete(`/seasons/${id}`).then((r) => r.data),
};