fix(roles): prevent 404 and silent user removal on large role edits (#40178)

Co-authored-by: madhushree agarwal <madhushree_agarwal@apple.com>
This commit is contained in:
madhushreeag
2026-05-19 09:13:43 -07:00
committed by GitHub
co-authored by madhushree agarwal
parent ac5e8f1308
commit 852d0182b5
3 changed files with 23 additions and 3 deletions
@@ -28,6 +28,7 @@ interface FetchPaginatedOptions {
setData: (data: any[]) => void;
setLoadingState: Dispatch<SetStateAction<any>>;
filters?: SupersetFilter[];
orderBy?: { column: string; direction: 'asc' | 'desc' };
loadingKey: string;
addDangerToast: (message: string) => void;
errorMessage?: string;
@@ -38,6 +39,8 @@ interface QueryObj {
page_size: number;
page: number;
filters?: SupersetFilter[];
order_column?: string;
order_direction?: 'asc' | 'desc';
}
interface SupersetFilter {
@@ -51,6 +54,7 @@ export const fetchPaginatedData = async ({
pageSize = 100,
setData,
filters,
orderBy,
setLoadingState,
loadingKey,
addDangerToast,
@@ -66,6 +70,10 @@ export const fetchPaginatedData = async ({
if (filters) {
queryObj.filters = filters;
}
if (orderBy) {
queryObj.order_column = orderBy.column;
queryObj.order_direction = orderBy.direction;
}
const encodedQuery = rison.encode(queryObj);
const response = await SupersetClient.get({