]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/videos/history-command.ts
Implement avatar miniatures (#4639)
[github/Chocobozzz/PeerTube.git] / shared / server-commands / videos / history-command.ts
index 13b7150c1c1d526727b96259a8c1db69035c7834..e9dc634626f39a29da5d5be7c14c6551e355b571 100644 (file)
@@ -3,7 +3,7 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared'
 
 export class HistoryCommand extends AbstractCommand {
 
-  wathVideo (options: OverrideCommandOptions & {
+  watchVideo (options: OverrideCommandOptions & {
     videoId: number | string
     currentTime: number
   }) {
@@ -40,7 +40,22 @@ export class HistoryCommand extends AbstractCommand {
     })
   }
 
-  remove (options: OverrideCommandOptions & {
+  removeElement (options: OverrideCommandOptions & {
+    videoId: number
+  }) {
+    const { videoId } = options
+    const path = '/api/v1/users/me/history/videos/' + videoId
+
+    return this.deleteRequest({
+      ...options,
+
+      path,
+      implicitToken: true,
+      defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
+    })
+  }
+
+  removeAll (options: OverrideCommandOptions & {
     beforeDate?: string
   } = {}) {
     const { beforeDate } = options