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, search?: string) {
18 const path = '/api/v1/users/me/history/videos'
20 return makeGetRequest({
27 statusCodeExpected: HttpStatusCode.OK_200
31 function removeMyVideosHistory (url: string, token: string, beforeDate?: string) {
32 const path = '/api/v1/users/me/history/videos/remove'
34 return makePostBodyRequest({
38 fields: beforeDate ? { beforeDate } : {},
39 statusCodeExpected: HttpStatusCode.NO_CONTENT_204
43 // ---------------------------------------------------------------------------