mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-06 09:39:08 +00:00
FIX: Ref Catalogo new functions models
This commit is contained in:
@@ -25,7 +25,9 @@ import {
|
||||
ICatalogAllResponse,
|
||||
IColumnsMetadataResponse,
|
||||
IDocsResponse,
|
||||
IOneDataAsset,
|
||||
IPreviewResponse,
|
||||
IUpdateDataRequest,
|
||||
} from './dtos';
|
||||
|
||||
@ApiTags('Catalog')
|
||||
@@ -279,11 +281,30 @@ export class CatalogController {
|
||||
@Put('data-asset/:id')
|
||||
async updateDataAsset(
|
||||
@User() user: RequestUser,
|
||||
@Headers() headers,
|
||||
@Headers('Dadosfera-Lang') language,
|
||||
@Param('id') id,
|
||||
) {
|
||||
console.log(user, headers);
|
||||
return { data_asset_id: id, message: 'Under development' };
|
||||
@Body() body: IUpdateDataRequest,
|
||||
): Promise<IOneDataAsset> {
|
||||
const { customer_id, customer_name, user_id, username } = user;
|
||||
const metadata = PackTheMetadata({
|
||||
customer_id,
|
||||
customer_name,
|
||||
user_id,
|
||||
username,
|
||||
language,
|
||||
});
|
||||
|
||||
const result = await this.catalogService.updateOneDataAsset({
|
||||
body,
|
||||
data_asset_id: id,
|
||||
customer_id,
|
||||
metadata,
|
||||
});
|
||||
|
||||
delete result.data_asset.p_roles;
|
||||
delete result.data_asset.p_users;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Post('data-asset/:id/docs')
|
||||
|
||||
Reference in New Issue
Block a user