From 444c0a0e017824fb4ce526281a22c4abe0a13c50 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 May 2020 16:56:15 +0200 Subject: Add ability to bulk delete comments --- shared/extra-utils/bulk/bulk.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 shared/extra-utils/bulk/bulk.ts (limited to 'shared/extra-utils/bulk/bulk.ts') diff --git a/shared/extra-utils/bulk/bulk.ts b/shared/extra-utils/bulk/bulk.ts new file mode 100644 index 000000000..d6798ceb7 --- /dev/null +++ b/shared/extra-utils/bulk/bulk.ts @@ -0,0 +1,24 @@ +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' + + return makePostBodyRequest({ + url, + path, + token, + fields: attributes, + statusCodeExpected: expectedStatus || 204 + }) +} + +export { + bulkRemoveCommentsOf +} -- cgit v1.2.3