UPDATE: modifyed catalog tags route to use opensearch instead of nimbus

This commit is contained in:
rodrigo.zamboni
2022-09-27 09:35:48 -03:00
parent d96658c9cd
commit 49663c4115
5 changed files with 123 additions and 45 deletions
+38 -11
View File
@@ -338,20 +338,36 @@ export class CatalogController {
user: body.info.user_id,
customer: body.info.customer,
});
const { user_id, customer, customer_id } = body.info;
const metadata = PackTheMetadata({
user_id,
customer_id,
customer_name: customer,
});
const res = await this.catalogService.createTags(body);
const res = await this.catalogService.createTags(body, metadata);
return res;
return res.data_assets;
}
@Get('tags')
async findAllTags(@Body() body) {
@Get('tags/:id')
async findAllTags(@Body() body, @Param() params) {
this.logger.info(`/catalog - ON FIND ALL TAGS ROUTE`, {
user: body.info.user_id,
customer: body.info.customer,
});
const res = await this.catalogService.findAllTags(body);
const { id } = params;
body.data_asset_id = id;
const { user_id, customer, customer_id } = body.info;
const metadata = PackTheMetadata({
user_id,
customer_id,
customer_name: customer,
});
const res = await this.catalogService.findAllTags(body, metadata);
return res;
}
@@ -363,8 +379,14 @@ export class CatalogController {
customer: body.info.customer,
});
const { id } = params;
const res = await this.catalogService.deleteTags(id, body);
body.data_asset_id = id;
const { user_id, customer, customer_id } = body.info;
const metadata = PackTheMetadata({
user_id,
customer_id,
customer_name: customer,
});
const res = await this.catalogService.deleteTags(body, metadata);
return res;
}
@@ -381,14 +403,19 @@ export class CatalogController {
return res;
}
@Get('table-tags')
async getAllTableTags(@Body() body) {
@Get('table-tags/:data_asset_id')
async getAllTableTags(@Body() body, @Param() params) {
this.logger.info(`/catalog - ON GET ALL TABLE TAGS ROUTE`, {
user: body.info.user_id,
customer: body.info.customer,
});
const res = await this.catalogService.findAllTableTags(body);
const { user_id, customer, customer_id } = body.info;
const metadata = PackTheMetadata({
user_id,
customer_id,
customer_name: customer,
});
const res = await this.catalogService.findAllTableTags(params, metadata);
return res;
}