mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 20:19:30 +00:00
25 lines
591 B
TypeScript
25 lines
591 B
TypeScript
import APIClient from '../../functions/APIClient';
|
|
|
|
type VideoProgressResponseType = {
|
|
watched: boolean;
|
|
duration: number;
|
|
duration_str: string;
|
|
watched_date: number;
|
|
position: number;
|
|
youtube_id: string;
|
|
};
|
|
|
|
type VideoProgressProp = {
|
|
youtubeId: string;
|
|
currentProgress: number;
|
|
};
|
|
|
|
const updateVideoProgressById = async ({ youtubeId, currentProgress }: VideoProgressProp) => {
|
|
return APIClient<VideoProgressResponseType>(`/api/video/${youtubeId}/progress/`, {
|
|
method: 'POST',
|
|
body: { position: currentProgress },
|
|
});
|
|
};
|
|
|
|
export default updateVideoProgressById;
|