function refactored

This commit is contained in:
VividTruthKeeper 2022-08-19 23:17:43 +05:00
parent 61aae91996
commit f63c820cab
1 changed files with 8 additions and 2 deletions

View File

@ -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<SlideProps[]>
@ -93,11 +95,15 @@ export const getEvent = (
});
};
export const getVideos = (setState: any) => {
export const getVideos = (
setVideoData: React.Dispatch<Video[]>,
setVideo: playerType[1]
) => {
axios
.get(videos)
.then((res) => {
setState(res.data.data);
setVideoData(res.data.data);
setVideo(res.data.data[0].video);
})
.catch();
};