mediahub-fe/service/schedule/schedule.ts

45 lines
1.2 KiB
TypeScript

import { httpGetInterceptor, httpPostInterceptor } from "../http-config/http-interceptor-service";
import { httpGet } from "../http-config/http-base-service";
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";
return httpPostInterceptor(url, data);
}
export async function detailSchedule(id: any) {
const url = `public/schedule?id=${id}`;
return httpGetInterceptor(url);
}
export async function listScheduleTodayPublic(group = null) {
const url = `public/schedule/today?group=${group}`;
return httpGet( url, null );
}
export async function listScheduleNextPublic(group = null) {
const url = `public/schedule/next-activity?group=${group}`;
return httpGet( url, null );
}
export async function listSchedulePrevPublic(group = null) {
const url = `public/schedule/prev-activity?group=${group}`;
return httpGet( url, null );
}
export async function listSchedule(group = null) {
const url = `public/schedule/list?group=${group}`;
return httpGet( url, null );
}