Skip to content

Commit

Permalink
Makes query param required
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Apr 4, 2024
1 parent 6b3687c commit eb77fe6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 5 additions & 1 deletion public/apps/configuration/panels/role-view/role-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion public/apps/configuration/utils/role-list-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
8 changes: 2 additions & 6 deletions public/apps/configuration/utils/role-mapping-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<RoleMappingDetail>({
http,
url: getResourceUrl(API_ENDPOINT_ROLESMAPPING, roleName),
Expand All @@ -61,7 +57,7 @@ export async function updateRoleMapping(
http: HttpStart,
roleName: string,
updateObject: RoleMappingDetail,
query?: HttpFetchQuery
query: HttpFetchQuery
) {
return await httpPost({
http,
Expand Down

0 comments on commit eb77fe6

Please sign in to comment.