FIX: fix catalog route to use openSearch

This commit is contained in:
rodrigo.zamboni
2022-09-19 11:14:23 -03:00
parent 3d39affc61
commit c3877657ef
8 changed files with 133 additions and 26 deletions
+13 -2
View File
@@ -13,6 +13,7 @@ import { AuthenticateCondition } from '../../authentication/authentication.decor
import { PERMISSIONS_GROUPS } from '../../authentication/permissions.enum';
import { CatalogService } from './catalog.service';
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
import { PackTheMetadata } from 'src/utils/ PackTheMetadata';
@ApiTags('Catalog')
@Controller('catalog')
@@ -48,14 +49,24 @@ export class CatalogController {
@Get('all')
async catalogAll(@Body() body) {
const { user_id, customer, customer_id } = body.info;
this.logger.info(`/catalog - ON CATALOG ALL ROUTE`, {
user: body.info.user_id,
customer: body.info.customer,
});
const res = await this.catalogService.catalogAll(body);
const metadata = PackTheMetadata({
user_id,
customer_id,
customer_name: customer,
});
return res;
const res = await this.catalogService.getAllOpenSearchDataAssets(
body,
metadata,
);
return { tables: res.data_assets };
}
@Get('data_apps')