diff --git a/public/apps/configuration/panels/role-view/role-view.tsx b/public/apps/configuration/panels/role-view/role-view.tsx index f4d1cf5ca..5f1ba3e5f 100644 --- a/public/apps/configuration/panels/role-view/role-view.tsx +++ b/public/apps/configuration/panels/role-view/role-view.tsx @@ -370,7 +370,11 @@ export function RoleView(props: RoleViewProps) { color="danger" onClick={async () => { try { - await requestDeleteRoles(props.coreStart.http, [props.roleName]); + await requestDeleteRoles( + props.coreStart.http, + [props.roleName], + createDataSourceQuery(dataSource.id) + ); setCrossPageToast(buildUrl(ResourceType.roles), { id: 'deleteRole', color: 'success', diff --git a/public/apps/configuration/utils/role-list-utils.tsx b/public/apps/configuration/utils/role-list-utils.tsx index 78cbe7ffd..5092085dc 100644 --- a/public/apps/configuration/utils/role-list-utils.tsx +++ b/public/apps/configuration/utils/role-list-utils.tsx @@ -92,7 +92,7 @@ export function buildSearchFilterOptions(roleList: any[], attrName: string): Arr } // Submit request to delete given roles. No error handling in this function. -export async function requestDeleteRoles(http: HttpStart, roles: string[], query?: HttpFetchQuery) { +export async function requestDeleteRoles(http: HttpStart, roles: string[], query: HttpFetchQuery) { for (const role of roles) { await httpDelete({ http, url: getResourceUrl(API_ENDPOINT_ROLES, role), query }); await httpDeleteWithIgnores({ diff --git a/public/apps/configuration/utils/role-mapping-utils.tsx b/public/apps/configuration/utils/role-mapping-utils.tsx index 62b7a291f..856f7c685 100644 --- a/public/apps/configuration/utils/role-mapping-utils.tsx +++ b/public/apps/configuration/utils/role-mapping-utils.tsx @@ -30,11 +30,7 @@ export enum UserType { external = 'Backend role', } -export async function getRoleMappingData( - http: HttpStart, - roleName: string, - query?: HttpFetchQuery -) { +export async function getRoleMappingData(http: HttpStart, roleName: string, query: HttpFetchQuery) { return httpGetWithIgnores({ http, url: getResourceUrl(API_ENDPOINT_ROLESMAPPING, roleName), @@ -61,7 +57,7 @@ export async function updateRoleMapping( http: HttpStart, roleName: string, updateObject: RoleMappingDetail, - query?: HttpFetchQuery + query: HttpFetchQuery ) { return await httpPost({ http,