Skip to content

Commit

Permalink
Merge pull request #1163 from merico-dev/fix-datasource-delete-interf…
Browse files Browse the repository at this point in the history
…ace-response

return id when deleting datasource
  • Loading branch information
miguel-lansdorf authored Sep 6, 2023
2 parents 24c6a5a + 05523cd commit afb3baa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/src/controller/datasource.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
},
})
Expand All @@ -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);
}
Expand Down

0 comments on commit afb3baa

Please sign in to comment.