mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-27 11:50:04 +00:00
PATCH: Ref/Catalog new functions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Headers,
|
||||
HttpException,
|
||||
@@ -333,16 +334,6 @@ export class CatalogController {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Post('data-asset/:id/comment')
|
||||
async makeAComment(
|
||||
@User() user: RequestUser,
|
||||
@Headers() headers,
|
||||
@Param('id') id,
|
||||
) {
|
||||
console.log(user, headers);
|
||||
return { data_asset_id: id, message: 'Under development' };
|
||||
}
|
||||
|
||||
@Put('data-asset/:id/manage-permissions')
|
||||
async manageDataAssetPermissions(
|
||||
@Param('id') id: string,
|
||||
@@ -384,4 +375,46 @@ export class CatalogController {
|
||||
|
||||
return { message: response.message };
|
||||
}
|
||||
|
||||
@Post('data-asset/:id/comment')
|
||||
async commentOnDataAsset(
|
||||
@Param('id') id: string,
|
||||
@User() user: RequestUser,
|
||||
@Body('message') message,
|
||||
) {
|
||||
const { customer_id, customer_name, user_id, username } = user;
|
||||
const metadata = PackTheMetadata({
|
||||
customer_id,
|
||||
customer_name,
|
||||
user_id,
|
||||
username,
|
||||
});
|
||||
const response = await this.catalogService.commentOnDataAsset(
|
||||
{ data_asset_id: id, username, message },
|
||||
metadata,
|
||||
);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Delete('data-asset/:id/comment')
|
||||
async deleteComment(
|
||||
@Param('id') id: string,
|
||||
@User() user: RequestUser,
|
||||
@Body() body,
|
||||
) {
|
||||
const { customer_id, customer_name, user_id, username } = user;
|
||||
const metadata = PackTheMetadata({
|
||||
customer_id,
|
||||
customer_name,
|
||||
user_id,
|
||||
username,
|
||||
});
|
||||
const response = await this.catalogService.deleteComment(
|
||||
{ data_asset_id: id, comment: body.comment },
|
||||
metadata,
|
||||
);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user