]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/videos/video-history.ts
Update dependencies.md
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / videos / video-history.ts
index 2d751cf148b1c44bf5381f15bdeb22cdd7693d77..b989e14dcaa38d0fbb2ed00efb58820098b4bec3 100644 (file)
@@ -1,20 +1,29 @@
 import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
 
-function userWatchVideo (url: string, token: string, videoId: number | string, currentTime: number, statusCodeExpected = 204) {
+function userWatchVideo (
+  url: string,
+  token: string,
+  videoId: number | string,
+  currentTime: number,
+  statusCodeExpected = HttpStatusCode.NO_CONTENT_204
+) {
   const path = '/api/v1/videos/' + videoId + '/watching'
   const fields = { currentTime }
 
   return makePutBodyRequest({ url, path, token, fields, statusCodeExpected })
 }
 
-function listMyVideosHistory (url: string, token: string) {
+function listMyVideosHistory (url: string, token: string, search?: string) {
   const path = '/api/v1/users/me/history/videos'
 
   return makeGetRequest({
     url,
     path,
     token,
+    query: {
+      search
+    },
     statusCodeExpected: HttpStatusCode.OK_200
   })
 }