1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add ability to delete history element

This commit is contained in:
Chocobozzz 2022-01-18 11:23:41 +01:00
parent 3b83faccff
commit 7177b46ca1
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 181 additions and 26 deletions

View 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