1 import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
2 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4 function userWatchVideo (
7 videoId: number | string,
9 statusCodeExpected = HttpStatusCode.NO_CONTENT_204
11 const path = '/api/v1/videos/' + videoId + '/watching'
12 const fields = { currentTime }
14 return makePutBodyRequest({ url, path, token, fields, statusCodeExpected })
17 function listMyVideosHistory (url: string, token: string) {
18 const path = '/api/v1/users/me/history/videos'
20 return makeGetRequest({
24 statusCodeExpected: HttpStatusCode.OK_200
28 function removeMyVideosHistory (url: string, token: string, beforeDate?: string) {
29 const path = '/api/v1/users/me/history/videos/remove'
31 return makePostBodyRequest({
35 fields: beforeDate ? { beforeDate } : {},
36 statusCodeExpected: HttpStatusCode.NO_CONTENT_204
40 // ---------------------------------------------------------------------------