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

Function updateDatasetRow

packages/server/src/services/dataset/index.ts:321–346  ·  view source on GitHub ↗
(id: string, body: any)

Source from the content-addressed store, hash-verified

319
320// Update row for a dataset
321const updateDatasetRow = async (id: string, body: any) => {
322 try {
323 const appServer = getRunningExpressApp()
324 const item = await appServer.AppDataSource.getRepository(DatasetRow).findOneBy({
325 id: id
326 })
327 if (!item) throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Dataset Row ${id} not found`)
328
329 const dataset = await appServer.AppDataSource.getRepository(Dataset).findOneBy({
330 id: item.datasetId,
331 workspaceId: body.workspaceId
332 })
333 if (!dataset) throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Dataset Row ${id} not found`)
334
335 item.input = body.input
336 item.output = body.output
337 const result = await appServer.AppDataSource.getRepository(DatasetRow).save(item)
338 await changeUpdateOnDataset(item.datasetId, body.workspaceId)
339 return result
340 } catch (error) {
341 throw new InternalFlowiseError(
342 StatusCodes.INTERNAL_SERVER_ERROR,
343 `Error: datasetService.updateDatasetRow - ${getErrorMessage(error)}`
344 )
345 }
346}
347
348// Delete dataset row via id
349const deleteDatasetRow = async (id: string, workspaceId: string) => {

Callers

nothing calls this directly

Calls 3

getRunningExpressAppFunction · 0.90
getErrorMessageFunction · 0.90
changeUpdateOnDatasetFunction · 0.85

Tested by

no test coverage detected