Initial commit
This commit is contained in:
17
src/shared/api/schedule.ts
Normal file
17
src/shared/api/schedule.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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/43nolroEBc5PNSMub6VR8G?access_token=${config.CONTENTFUL_TOKEN}`,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user