mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-09-27 04:01:44 +02:00
feat(core): Add delete rows endpoint to data store module (no-changelog) (#18376)
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
AddDataStoreRowsDto,
|
||||
AddDataStoreColumnDto,
|
||||
CreateDataStoreDto,
|
||||
DeleteDataStoreRowsQueryDto,
|
||||
ListDataStoreContentQueryDto,
|
||||
ListDataStoreQueryDto,
|
||||
MoveDataStoreColumnDto,
|
||||
@@ -277,4 +278,26 @@ export class DataStoreController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Delete('/:dataStoreId/rows')
|
||||
@ProjectScope('dataStore:writeRow')
|
||||
async deleteDataStoreRows(
|
||||
req: AuthenticatedRequest<{ projectId: string }>,
|
||||
_res: Response,
|
||||
@Param('dataStoreId') dataStoreId: string,
|
||||
@Query dto: DeleteDataStoreRowsQueryDto,
|
||||
) {
|
||||
try {
|
||||
const { ids } = dto;
|
||||
return await this.dataStoreService.deleteRows(dataStoreId, req.params.projectId, ids);
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof DataStoreNotFoundError) {
|
||||
throw new NotFoundError(e.message);
|
||||
} else if (e instanceof Error) {
|
||||
throw new InternalServerError(e.message, e);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user