FEAT: Create Data Asset

This commit is contained in:
Victor Radael
2022-11-03 17:18:20 -03:00
parent 0103f100f5
commit 4b4bdfea61
6 changed files with 63 additions and 12 deletions
+21
View File
@@ -25,6 +25,7 @@ import { RequestUser, User } from 'src/authentication/user.decorator';
import {
ICatalogAllResponse,
IColumnsMetadataResponse,
ICreateDataAsset,
IDeleteComment,
IDocsResponse,
IMakeAComment,
@@ -432,6 +433,26 @@ export class CatalogController {
return { message: response.message };
}
@Post()
async createDataAsset(
@User() user: RequestUser,
@Body() body: ICreateDataAsset,
) {
const { customer_id, customer_name, user_id, username } = user;
const metadata = PackTheMetadata({
customer_id,
customer_name,
user_id,
username,
});
const { data_asset } = await this.catalogService.createDataAsset(
body,
metadata,
);
return { data_asset: JSON.parse(data_asset) };
}
@Post('data-asset/:id/comment')
async commentOnDataAsset(
@Param('id') id: string,