feature: allow delete request to accept body (#39817)

This commit is contained in:
An 2021-09-30 10:59:53 -04:00 committed by GitHub
parent 451d023c79
commit fffbdf4c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -140,7 +140,7 @@ export interface FetchError<T extends FetchErrorDataProps = any> {
*/
export interface BackendSrv {
get(url: string, params?: any, requestId?: string): Promise<any>;
delete(url: string): Promise<any>;
delete(url: string, data?: any): Promise<any>;
post(url: string, data?: any): Promise<any>;
patch(url: string, data?: any): Promise<any>;
put(url: string, data?: any): Promise<any>;

View File

@ -385,8 +385,8 @@ export class BackendSrv implements BackendService {
return await this.request({ method: 'GET', url, params, requestId });
}
async delete(url: string) {
return await this.request({ method: 'DELETE', url });
async delete(url: string, data?: any) {
return await this.request({ method: 'DELETE', url, data });
}
async post(url: string, data?: any) {