mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-07 22:49:23 +00:00
Refac prepare updating watched state based on progress endpoint
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
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) => {
|
||||
const updateVideoProgressById = async ({
|
||||
youtubeId,
|
||||
currentProgress,
|
||||
}: VideoProgressProp): Promise<VideoProgressResponseType> => {
|
||||
return APIClient(`/api/video/${youtubeId}/progress/`, {
|
||||
method: 'POST',
|
||||
body: { position: currentProgress },
|
||||
|
||||
Reference in New Issue
Block a user