MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / patchDeleteRows

Function patchDeleteRows

packages/server/src/services/dataset/index.ts:371–392  ·  view source on GitHub ↗
(ids: string[] = [], workspaceId: string)

Source from the content-addressed store, hash-verified

369
370// Delete dataset rows via ids
371const 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
394export default {
395 getAllDatasets,

Callers

nothing calls this directly

Calls 4

getRunningExpressAppFunction · 0.90
getErrorMessageFunction · 0.90
changeUpdateOnDatasetFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected