mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
refactor(FE): Conditionally load data based on filter modal state
This commit is contained in:
@@ -313,7 +313,7 @@ const RecordingTable = () => {
|
|||||||
isLoadingOptions: isLoadingLocationOptions,
|
isLoadingOptions: isLoadingLocationOptions,
|
||||||
loadMore: loadMoreLocations,
|
loadMore: loadMoreLocations,
|
||||||
} = useSelect<Location>(
|
} = useSelect<Location>(
|
||||||
LocationApi.basePath,
|
filterModal.open ? LocationApi.basePath : null,
|
||||||
'id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
'search',
|
'search',
|
||||||
@@ -325,7 +325,12 @@ const RecordingTable = () => {
|
|||||||
options: areaOptions,
|
options: areaOptions,
|
||||||
isLoadingOptions: isLoadingAreaOptions,
|
isLoadingOptions: isLoadingAreaOptions,
|
||||||
loadMore: loadMoreAreas,
|
loadMore: loadMoreAreas,
|
||||||
} = useSelect<Area>(AreaApi.basePath, 'id', 'name', 'search');
|
} = useSelect<Area>(
|
||||||
|
filterModal.open ? AreaApi.basePath : null,
|
||||||
|
'id',
|
||||||
|
'name',
|
||||||
|
'search'
|
||||||
|
);
|
||||||
|
|
||||||
const projectFlockParams = useMemo(() => {
|
const projectFlockParams = useMemo(() => {
|
||||||
if (filterProjectFlockLocationId) {
|
if (filterProjectFlockLocationId) {
|
||||||
@@ -341,7 +346,7 @@ const RecordingTable = () => {
|
|||||||
isLoadingOptions: isLoadingProjectFlocks,
|
isLoadingOptions: isLoadingProjectFlocks,
|
||||||
loadMore: loadMoreProjectFlocks,
|
loadMore: loadMoreProjectFlocks,
|
||||||
} = useSelect(
|
} = useSelect(
|
||||||
ProjectFlockApi.basePath,
|
filterModal.open ? ProjectFlockApi.basePath : null,
|
||||||
'id',
|
'id',
|
||||||
'flock_name',
|
'flock_name',
|
||||||
'search',
|
'search',
|
||||||
|
|||||||
Reference in New Issue
Block a user