Skip to content

Commit

Permalink
Fix unexpected 'eslint-disable-next-line' comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
lublagg committed Sep 20, 2023
1 parent 9afc224 commit 690988d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const fetchDataWithRetry = async (req: string, maxRetries = 3) => {
const json = await response.json();
return json;
} catch (error) {
// eslint-disable-next-line
// eslint-disable-next-line no-console
console.log(`Request attempt ${retries + 1} failed:`, error);
retries++;
}
Expand Down Expand Up @@ -93,12 +93,15 @@ export const createRequest = ({attribute, geographicLevel, location, year, cropC

export const createTableFromSelections = async (selectedOptions: IStateOptions) => {
const {geographicLevel, states, cropUnits, years, ...subOptions} = selectedOptions;
try {
const items = await getItems(selectedOptions);
if (items.length > 4000) {

Check failure on line 98 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / Build and Run Jest Tests

Empty block statement

await connect.getNewDataContext();
await connect.createTopCollection(geographicLevel);
const allAttrs: Array<string|ICropDataItem> = ["Year"];
}
await connect.getNewDataContext();
await connect.createTopCollection(geographicLevel);
const allAttrs: Array<string|ICropDataItem> = ["Year"];

try {
for (const key in subOptions) {
const selections = subOptions[key as keyof typeof subOptions];
for (const attribute of selections) {
Expand All @@ -120,7 +123,6 @@ export const createTableFromSelections = async (selectedOptions: IStateOptions)
}

await connect.createSubCollection(geographicLevel, allAttrs);
const items = await getItems(selectedOptions);
await connect.createItems(items);
await connect.makeCaseTableAppear();
return "success";
Expand Down Expand Up @@ -229,6 +231,7 @@ const getAttrData = async (params: IGetAttrDataParams) => {
return values[codapColumnName] = dataItem.Value;
});
} else {
// eslint-disable-next-line no-console
console.log(`Error: did not receive response for item with these params: ${params}`);
}
return values;
Expand Down

0 comments on commit 690988d

Please sign in to comment.