aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-18 11:23:41 +0100
committerChocobozzz <me@florianbigard.com>2022-01-18 11:23:41 +0100
commit7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180 (patch)
tree016cb0d966fe9fea8a6381eb246e966f5c4eae57 /shared/server-commands/videos
parent3b83faccfffc13adaef0b63c211b1ce4944e8b3b (diff)
downloadPeerTube-7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180.tar.gz
PeerTube-7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180.tar.zst
PeerTube-7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180.zip
Add ability to delete history element
Diffstat (limited to 'shared/server-commands/videos')
-rw-r--r--shared/server-commands/videos/history-command.ts19
1 files changed, 17 insertions, 2 deletions
diff --git a/shared/server-commands/videos/history-command.ts b/shared/server-commands/videos/history-command.ts
index 13b7150c1..e9dc63462 100644
--- a/shared/server-commands/videos/history-command.ts
+++ b/shared/server-commands/videos/history-command.ts
@@ -3,7 +3,7 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared'
3 3
4export class HistoryCommand extends AbstractCommand { 4export class HistoryCommand extends AbstractCommand {
5 5
6 wathVideo (options: OverrideCommandOptions & { 6 watchVideo (options: OverrideCommandOptions & {
7 videoId: number | string 7 videoId: number | string
8 currentTime: number 8 currentTime: number
9 }) { 9 }) {
@@ -40,7 +40,22 @@ export class HistoryCommand extends AbstractCommand {
40 }) 40 })
41 } 41 }
42 42
43 remove (options: OverrideCommandOptions & { 43 removeElement (options: OverrideCommandOptions & {
44 videoId: number
45 }) {
46 const { videoId } = options
47 const path = '/api/v1/users/me/history/videos/' + videoId
48
49 return this.deleteRequest({
50 ...options,
51
52 path,
53 implicitToken: true,
54 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
55 })
56 }
57
58 removeAll (options: OverrideCommandOptions & {
44 beforeDate?: string 59 beforeDate?: string
45 } = {}) { 60 } = {}) {
46 const { beforeDate } = options 61 const { beforeDate } = options