Skip to content

Commit

Permalink
fix eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-vi committed Dec 16, 2024
1 parent fb33aa2 commit 21c5083
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions app/api/csv/importEntity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable no-await-in-loop */
/* eslint-disable no-unreachable-loop */
/* eslint-disable no-restricted-syntax */
// eslint-disable-next-line node/no-restricted-import
import { createReadStream } from 'fs';
import entities from 'api/entities';
Expand Down Expand Up @@ -179,31 +176,33 @@ const translateEntity = async (
indexedTranslations: FullyIndexedTranslations,
dateFormat?: string
) => {
for (const translatedEntity of translations) {
await translations.reduce(async (prevPromise, translation) => {
await prevPromise;

const entityParsed = await entityObject(
{
...translatedEntity,
...translation,
propertiesFromColumns: {
...translatedEntity.propertiesFromColumns,
...translation.propertiesFromColumns,
id: ensure(entity.sharedId),
},
},
template,
{
language: translatedEntity.language,
language: translation.language,
dateFormat,
}
);

const toSave = translateSelectLabels(
entityParsed,
translatedEntity.language,
translation.language,
indexedTranslations,
propNameToThesauriId
);

await entities.save(toSave, { language: translatedEntity.language, user: {} });
}
await entities.save(toSave, { language: translation.language, user: {} });
}, Promise.resolve());

await Promise.all(
translations.map(async translatedEntity => {
Expand Down

0 comments on commit 21c5083

Please sign in to comment.