(ids: string[] = [], workspaceId: string)
| 369 | |
| 370 | // Delete dataset rows via ids |
| 371 | const patchDeleteRows = async (ids: string[] = [], workspaceId: string) => { |
| 372 | try { |
| 373 | const appServer = getRunningExpressApp() |
| 374 | const datasetItemsToBeDeleted = await appServer.AppDataSource.getRepository(DatasetRow).find({ |
| 375 | where: { |
| 376 | id: In(ids) |
| 377 | } |
| 378 | }) |
| 379 | const dbResponse = await appServer.AppDataSource.getRepository(DatasetRow).delete(ids) |
| 380 | |
| 381 | const datasetIds = [...new Set(datasetItemsToBeDeleted.map((item) => item.datasetId))] |
| 382 | for (const datasetId of datasetIds) { |
| 383 | await changeUpdateOnDataset(datasetId, workspaceId) |
| 384 | } |
| 385 | return dbResponse |
| 386 | } catch (error) { |
| 387 | throw new InternalFlowiseError( |
| 388 | StatusCodes.INTERNAL_SERVER_ERROR, |
| 389 | `Error: datasetService.patchDeleteRows - ${getErrorMessage(error)}` |
| 390 | ) |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | export default { |
| 395 | getAllDatasets, |
nothing calls this directly
no test coverage detected