]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - shared/extra-utils/bulk/bulk.ts
Introduce bulk command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / bulk / bulk.ts
... / ...
CommitLineData
1
2import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4import { AbstractCommand, CommonCommandOptions } from '../shared'
5
6class BulkCommand extends AbstractCommand {
7
8 removeCommentsOf (options: CommonCommandOptions & {
9 attributes: BulkRemoveCommentsOfBody
10 }) {
11 const { attributes } = options
12
13 return this.postBodyRequest({
14 ...options,
15 path: '/api/v1/bulk/remove-comments-of',
16 fields: attributes,
17 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
18 })
19 }
20}
21
22export {
23 BulkCommand
24}