mediahub-fe/service/schedule/schedule.ts

56 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-01-18 15:13:47 +00:00
import {
httpGetInterceptor,
httpPostInterceptor,
} from "../http-config/http-interceptor-service";
2025-01-01 17:48:57 +00:00
import { httpGet } from "../http-config/http-base-service";
2025-01-15 15:59:19 +00:00
import { any } from "zod";
2025-01-15 15:59:19 +00:00
export async function paginationSchedule(size: number, page: number, type: any, title: string = "") {
return await httpGetInterceptor(`schedule/pagination?enablePage=1&scheduleTypeId=${type}&page=${page}&size=${size}&title=${title}`);
}
export async function postSchedule(data: any) {
const url = "schedule";
2025-01-01 17:48:57 +00:00
return httpPostInterceptor(url, data);
}
export async function detailSchedule(id: any) {
const url = `public/schedule?id=${id}`;
2025-01-01 17:48:57 +00:00
return httpGetInterceptor(url);
}
2024-12-13 14:33:59 +00:00
export async function listScheduleTodayPublic(group = null) {
const url = `public/schedule/today?group=${group}`;
2025-01-15 15:59:19 +00:00
return httpGet(url, null);
}
export async function listScheduleNextPublic(group = null) {
const url = `public/schedule/next-activity?group=${group}`;
2025-01-15 15:59:19 +00:00
return httpGet(url, null);
}
export async function listSchedulePrevPublic(group = null) {
const url = `public/schedule/prev-activity?group=${group}`;
2025-01-15 15:59:19 +00:00
return httpGet(url, null);
}
export async function listSchedule(group = null) {
const url = `public/schedule/list?group=${group}`;
2025-01-15 15:59:19 +00:00
return httpGet(url, null);
}
2024-12-13 14:33:59 +00:00
2025-01-15 15:59:19 +00:00
export async function searchSchedules(search = null) {
const url = `public/schedule/list?search=${search}`;
return httpGet(url, null);
}
2025-01-18 15:13:47 +00:00
export async function listScheduleToday() {
const url = "schedule/today";
return httpGetInterceptor(url);
}
export async function listScheduleNext() {
const url = "schedule/next-activity";
return httpGetInterceptor(url);
}