1 import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
3 function userWatchVideo (url: string, token: string, videoId: number | string, currentTime: number, statusCodeExpected = 204) {
4 const path = '/api/v1/videos/' + videoId + '/watching'
5 const fields = { currentTime }
7 return makePutBodyRequest({ url, path, token, fields, statusCodeExpected })
10 function listMyVideosHistory (url: string, token: string) {
11 const path = '/api/v1/users/me/history/videos'
13 return makeGetRequest({
17 statusCodeExpected: 200
21 function removeMyVideosHistory (url: string, token: string, beforeDate?: string) {
22 const path = '/api/v1/users/me/history/videos/remove'
24 return makePostBodyRequest({
28 fields: beforeDate ? { beforeDate } : {},
29 statusCodeExpected: 204
33 // ---------------------------------------------------------------------------