From 05523cdd660411838f6fa43474178f0b08b0c1a4 Mon Sep 17 00:00:00 2001 From: Miguel Lansdorf Date: Wed, 6 Sep 2023 12:19:46 +0800 Subject: [PATCH] return id when deleting datasource --- api/src/controller/datasource.controller.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/controller/datasource.controller.ts b/api/src/controller/datasource.controller.ts index a96efa334..e8e240c77 100644 --- a/api/src/controller/datasource.controller.ts +++ b/api/src/controller/datasource.controller.ts @@ -154,7 +154,11 @@ export class DataSourceController implements interfaces.Controller { body: { description: 'datasource ID request', required: true, model: 'DataSourceIDRequest' }, }, responses: { - 200: { description: 'SUCCESS' }, + 200: { + description: 'SUCCESS', + type: SwaggerDefinitionConstant.Response.Type.OBJECT, + model: 'DataSourceIDRequest', + }, 500: { description: 'SERVER ERROR', type: SwaggerDefinitionConstant.Response.Type.OBJECT, model: 'ApiError' }, }, }) @@ -167,7 +171,7 @@ export class DataSourceController implements interfaces.Controller { try { const { id } = req.body as DataSourceIDRequest; await this.dataSourceService.delete(id, req.locale); - res.json(); + res.json({ id }); } catch (err) { next(err); }