-import { BulkRemoveCommentsOfBody } from "@shared/models/bulk/bulk-remove-comments-of-body.model"
-import { makePostBodyRequest } from "../requests/requests"
-function bulkRemoveCommentsOf (options: {
- url: string
- token: string
- attributes: BulkRemoveCommentsOfBody
- expectedStatus?: number
-}) {
- const { url, token, attributes, expectedStatus } = options
- const path = '/api/v1/bulk/remove-comments-of'
+import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
+import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
+import { AbstractCommand, OverrideCommandOptions } from '../shared'
- return makePostBodyRequest({
- url,
- path,
- token,
- fields: attributes,
- statusCodeExpected: expectedStatus || 204
- })
-}
+export class BulkCommand extends AbstractCommand {
+
+ removeCommentsOf (options: OverrideCommandOptions & {
+ attributes: BulkRemoveCommentsOfBody
+ }) {
+ const { attributes } = options
-export {
- bulkRemoveCommentsOf
+ return this.postBodyRequest({
+ ...options,
+ path: '/api/v1/bulk/remove-comments-of',
+ fields: attributes,
+ defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
+ })
+ }
}