Skip to content

Commit 49f9614

Browse files
committed
Re-simplify requestType
1 parent 3267dfe commit 49f9614

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

packages/components/src/public/QueryModel/withQueryModels.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,9 @@ export function withQueryModels<Props>(
557557
);
558558

559559
try {
560-
const requestType = 'loadSelections';
561560
const selections = await loadSelections(
562561
this.state.queryModels[id],
563-
this.requestManager.getRequestHandler(id, requestType)
562+
this.requestManager.getRequestHandler(id, 'loadSelections')
564563
);
565564

566565
this.setState(
@@ -801,9 +800,7 @@ export function withQueryModels<Props>(
801800
// If we have selectionsForReplace, then skip request cancellation optimization
802801
let requestHandler: RequestHandler | undefined;
803802
if (!selectionsForReplace) {
804-
// Key requests as loadRows|<loadSelections> so loadSelection is respected
805-
const requestType = ['loadRows', loadSelections].join('|');
806-
requestHandler = this.requestManager.getRequestHandler(id, requestType);
803+
requestHandler = this.requestManager.getRequestHandler(id, 'loadRows');
807804
}
808805

809806
const result = await loadRows(this.state.queryModels[id], requestHandler);
@@ -917,7 +914,6 @@ export function withQueryModels<Props>(
917914
queryInfo?.getPkCols()
918915
);
919916

920-
const requestType = 'loadTotalCount';
921917
const { rowCount } = await selectRows({
922918
...loadRowsConfig,
923919
columns,
@@ -928,7 +924,7 @@ export function withQueryModels<Props>(
928924
maxRows: 1,
929925
offset: 0,
930926
sort: undefined,
931-
requestHandler: this.requestManager.getRequestHandler(id, requestType),
927+
requestHandler: this.requestManager.getRequestHandler(id, 'loadTotalCount'),
932928
});
933929

934930
this.setState(

0 commit comments

Comments
 (0)