18 lines
645 B
TypeScript
18 lines
645 B
TypeScript
import { config } from 'shared/configs'
|
|
import { baseRequest, IContentfulResponse } from 'shared/lib'
|
|
import { IHolidays } from 'shared/store/holidays/IHolidays'
|
|
import { ISchedule } from 'shared/store/schedule/ISchedule'
|
|
|
|
interface IScheduleResponse {
|
|
schedule: ISchedule
|
|
holidays: { data: IHolidays }
|
|
}
|
|
|
|
export type FetchScheduleResponse = IContentfulResponse<IScheduleResponse>
|
|
|
|
export const fetchSchedule = (): Promise<FetchScheduleResponse> => {
|
|
return baseRequest<FetchScheduleResponse>(
|
|
`https://cdn.contentful.com/spaces/ze9lyxygmq5z/environments/master/entries/1eo7haWl3AEcgwoR3YMcwn?access_token=${config.CONTENTFUL_TOKEN}`,
|
|
)
|
|
}
|