diff --git a/src/helpers/apiRequests.ts b/src/helpers/apiRequests.ts index e45defa..ce39a43 100644 --- a/src/helpers/apiRequests.ts +++ b/src/helpers/apiRequests.ts @@ -23,6 +23,8 @@ import { // Types import { ContactData, Contact } from "../types/contact"; +import { Video } from "../types/video"; +import { playerType } from "../types/players"; export const getMainSliderData = ( setState: React.Dispatch @@ -93,11 +95,15 @@ export const getEvent = ( }); }; -export const getVideos = (setState: any) => { +export const getVideos = ( + setVideoData: React.Dispatch, + setVideo: playerType[1] +) => { axios .get(videos) .then((res) => { - setState(res.data.data); + setVideoData(res.data.data); + setVideo(res.data.data[0].video); }) .catch(); };