Skip to content

Commit

Permalink
[DT-980] Fix the enumerate snapshots to get more snapshots than the f…
Browse files Browse the repository at this point in the history
…irst 10 (#2719)
  • Loading branch information
s-rubenstein authored Nov 7, 2024
1 parent e5e60a1 commit 8e42af6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/components/data_search/DatasetSearchTable.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Tab from '@mui/material/Tab';
import Tabs from '@mui/material/Tabs';
import useOnMount from '@mui/utils/useOnMount'
import * as React from 'react';
import { Box, Button } from '@mui/material';
import { useEffect, useState, useRef } from 'react';
import { useEffect, useState } from 'react';
import { isEmpty } from 'lodash';
import { TerraDataRepo } from '../../libs/ajax/TerraDataRepo';
import { DatasetSearchTableDisplay } from './DatasetSearchTableDisplay';
Expand Down Expand Up @@ -195,12 +196,12 @@ export const DatasetSearchTable = (props) => {
}
};

useEffect(() => {
if (isEmpty(filtered)) {
useOnMount(() => {
if (isEmpty(datasets)) {
return;
}
getExportableDatasets(filtered);
}, [filtered]);
getExportableDatasets(datasets);
});

useEffect(() => {
setFiltered(datasets);
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ajax/TerraDataRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const TerraDataRepo = {
};
const rootTdrApiUrl = await Config.getTdrApiUrl();
const snapshotPromises = partitionedIdentifiers.map(sublist => {
const url = `${rootTdrApiUrl}/api/repository/v1/snapshots?duosDatasetIds=${sublist.join('&duosDatasetIds=')}`;
// 1000 should be safe with only 70 DUOS IDs.
const url = `${rootTdrApiUrl}/api/repository/v1/snapshots?limit=1000&duosDatasetIds=${sublist.join('&duosDatasetIds=')}`;
return axios.get(url, Config.authOpts());
});
await Promise.all(snapshotPromises).then(function(responses) {
Expand Down

0 comments on commit 8e42af6

Please sign in to comment.