import { makeRequest } from './make-request'; import { HttpRequest } from '../types/request'; import { HttpResponse } from '../types/response'; /** * A function that makes a HTTP request with the DELETE method * @param url URL for the request * @param key secret key for the request * @param additionalHeaders any headers that are additional to contentType and x-api-key * @param targetApiSystemCode the BizOps system code to which the request is being made * @returns it returns a HTTP promise response */ export async function requestDelete ({ url, key, additionalHeaders = {}, targetApiSystemCode = '' }: HttpRequest, fetch: Function): Promise { const options = { method: 'DELETE', headers: { 'Content-Type': 'application/json', 'X-api-key': key, ...additionalHeaders } }; return makeRequest(url, options, fetch, targetApiSystemCode); }