( dataProvider: DataProvider, resource: string, values: any[] )
| 191 | } |
| 192 | |
| 193 | async function updateInDataProviderFallback( |
| 194 | dataProvider: DataProvider, |
| 195 | resource: string, |
| 196 | values: any[] |
| 197 | ): Promise<ReportItem[]> { |
| 198 | const reportItems: ReportItem[] = []; |
| 199 | await Promise.all( |
| 200 | values.map((value) => |
| 201 | dataProvider |
| 202 | .update(resource, { id: value.id, data: value, previousData: null as any }) |
| 203 | .then((res) => |
| 204 | reportItems.push({ value: value, success: true, response: res }) |
| 205 | ) |
| 206 | .catch((err) => reportItems.push({ value: value, success: false, err })) |
| 207 | ) |
| 208 | ); |
| 209 | return reportItems; |
| 210 | } |
| 211 | |
| 212 | function doesErrorContainString(error: any, stringsToCheck: string[]): boolean { |
| 213 | const errorString = (!!error && typeof error === 'object' && error?.toString()) || ''; |
no outgoing calls
no test coverage detected