From 94565d52bb2883e09f16d1363170ac9c0dccb7a1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 Apr 2019 15:26:15 +0200 Subject: Shared utils -> extra-utils Because they need dev dependencies --- shared/utils/videos/video-history.ts | 39 ------------------------------------ 1 file changed, 39 deletions(-) delete mode 100644 shared/utils/videos/video-history.ts (limited to 'shared/utils/videos/video-history.ts') diff --git a/shared/utils/videos/video-history.ts b/shared/utils/videos/video-history.ts deleted file mode 100644 index dc7095b4d..000000000 --- a/shared/utils/videos/video-history.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' - -function userWatchVideo (url: string, token: string, videoId: number | string, currentTime: number, statusCodeExpected = 204) { - const path = '/api/v1/videos/' + videoId + '/watching' - const fields = { currentTime } - - return makePutBodyRequest({ url, path, token, fields, statusCodeExpected }) -} - -function listMyVideosHistory (url: string, token: string) { - const path = '/api/v1/users/me/history/videos' - - return makeGetRequest({ - url, - path, - token, - statusCodeExpected: 200 - }) -} - -function removeMyVideosHistory (url: string, token: string, beforeDate?: string) { - const path = '/api/v1/users/me/history/videos/remove' - - return makePostBodyRequest({ - url, - path, - token, - fields: beforeDate ? { beforeDate } : {}, - statusCodeExpected: 204 - }) -} - -// --------------------------------------------------------------------------- - -export { - userWatchVideo, - listMyVideosHistory, - removeMyVideosHistory -} -- cgit v1.2.3