PeerTube/shared/extra-utils/bulk/bulk.ts

25 lines
655 B
TypeScript
Raw Normal View History

2021-07-05 14:57:03 +02:00
import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
2021-07-05 14:57:03 +02:00
import { AbstractCommand, CommonCommandOptions } from '../shared'
class BulkCommand extends AbstractCommand {
2020-05-14 16:56:15 +02:00
2021-07-05 14:57:03 +02:00
removeCommentsOf (options: CommonCommandOptions & {
attributes: BulkRemoveCommentsOfBody
}) {
const { attributes } = options
2020-05-14 16:56:15 +02:00
2021-07-05 14:57:03 +02:00
return this.postBodyRequest({
...options,
path: '/api/v1/bulk/remove-comments-of',
fields: attributes,
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
})
}
2020-05-14 16:56:15 +02:00
}
export {
2021-07-05 14:57:03 +02:00
BulkCommand
2020-05-14 16:56:15 +02:00
}