Implemented the new react version of the frontend
This commit is contained in:
1 parent
236e6e06fb
commit
ffe7e52527
65 files changed
+5228
-177
No files matched your search
@@ -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),
|
||||
};
|
||||
Reference in new issue
Block a user