function refactored
This commit is contained in:
parent
61aae91996
commit
f63c820cab
|
|
@ -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();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue