( logging: boolean, translate: Translate, dataProvider: DataProvider, csvIds: Identifier[], resourceName: string, )
| 68 | } |
| 69 | |
| 70 | export async function GetIdsCollidingGetMany( |
| 71 | logging: boolean, |
| 72 | translate: Translate, |
| 73 | dataProvider: DataProvider, |
| 74 | csvIds: Identifier[], |
| 75 | resourceName: string, |
| 76 | ): Promise<Identifier[]> { |
| 77 | const logger = makeLogger(logging); |
| 78 | try { |
| 79 | const recordsColliding = await dataProvider.getMany(resourceName, { |
| 80 | ids: csvIds, |
| 81 | }); |
| 82 | const recordIdsColliding = recordsColliding.data.map((r) => r.id); |
| 83 | return recordIdsColliding; |
| 84 | } catch (error) { |
| 85 | logger.error("GetIdsCollidingGetMany", { csvIds }, error); |
| 86 | throw translate("csv.parsing.collidingIds"); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | export async function CheckCSVValidation( |
| 91 | logging: boolean, |
no test coverage detected