FIX: Manage Permissions Catalog

This commit is contained in:
Victor Radael
2022-09-28 17:02:22 -03:00
3 changed files with 55 additions and 27 deletions
+10 -6
View File
@@ -259,15 +259,19 @@ export class CatalogController {
}
@Post('data-description')
async createDataDescription(@Body() body) {
async createDataDescription(@Body() body, @User() user: RequestUser) {
this.logger.info(`/catalog - ON CREATE DATA DESCRIPTION ROUTE`, {
user: body.info.user_id,
customer: body.info.customer,
user: user.user_id,
customer: user.customer_name,
});
const res = await this.catalogService.createDataDescription(body);
return res;
const { user_id, customer_name, customer_id } = user;
const metadata = PackTheMetadata({
user_id,
customer_id,
customer_name,
});
return await this.catalogService.createDataDescription(body, metadata);
}
@Get('data-docs')