mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-15 11:59:09 +00:00
FIX: Get a total and fix owner type
This commit is contained in:
@@ -151,7 +151,7 @@ class CatalogService implements OnModuleInit {
|
||||
) {
|
||||
this.logger.info('CatalogService - getAllOpenSearchDashboard');
|
||||
|
||||
const response = await lastValueFrom(
|
||||
const { data_assets, total } = await lastValueFrom(
|
||||
this.catalogReadService.GetAllDataAssets(data, metadata),
|
||||
).catch((err) => {
|
||||
throw new HttpException(
|
||||
@@ -160,7 +160,7 @@ class CatalogService implements OnModuleInit {
|
||||
);
|
||||
});
|
||||
|
||||
const result = JSON.parse(response.data_assets);
|
||||
const result = JSON.parse(data_assets);
|
||||
|
||||
const [customer_users, customer_roles] =
|
||||
await this.getUsernamesAndRolesByCustomerId(customer_id);
|
||||
@@ -197,7 +197,7 @@ class CatalogService implements OnModuleInit {
|
||||
});
|
||||
}
|
||||
|
||||
return { data_assets: result.data_assets };
|
||||
return { data_assets: result.data_assets, total };
|
||||
}
|
||||
|
||||
async getOneDataAsset({
|
||||
|
||||
@@ -14,6 +14,17 @@ export class IUser {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export class IComment {
|
||||
@ApiProperty()
|
||||
id: number;
|
||||
@ApiProperty()
|
||||
message: string;
|
||||
@ApiProperty()
|
||||
created_at: string;
|
||||
@ApiProperty()
|
||||
username: string;
|
||||
}
|
||||
|
||||
export class IDataAsset {
|
||||
@ApiProperty()
|
||||
id: number;
|
||||
@@ -50,7 +61,7 @@ export class IDataAsset {
|
||||
@ApiProperty()
|
||||
tags: string[];
|
||||
@ApiProperty()
|
||||
owner: IUser;
|
||||
owner: string;
|
||||
@ApiProperty({ type: [IRole] })
|
||||
roles: IRole[];
|
||||
@ApiProperty({ type: [IUser] })
|
||||
@@ -67,6 +78,8 @@ export class IDataAsset {
|
||||
created_at?: string;
|
||||
@ApiPropertyOptional()
|
||||
updated_at?: string;
|
||||
@ApiProperty({ type: [IComment] })
|
||||
comments: IComment[];
|
||||
}
|
||||
|
||||
export class IOneDataAsset {
|
||||
@@ -74,17 +87,6 @@ export class IOneDataAsset {
|
||||
data_asset: IDataAsset;
|
||||
}
|
||||
|
||||
export class IComment {
|
||||
@ApiProperty()
|
||||
id: number;
|
||||
@ApiProperty()
|
||||
message: string;
|
||||
@ApiProperty()
|
||||
created_at: string;
|
||||
@ApiProperty()
|
||||
username: string;
|
||||
}
|
||||
|
||||
export class IMakeAComment {
|
||||
@ApiProperty()
|
||||
message: string;
|
||||
@@ -98,6 +100,8 @@ export class IDeleteComment {
|
||||
export class ICatalogAllResponse {
|
||||
@ApiProperty({ type: [IDataAsset] })
|
||||
data_assets: IDataAsset[];
|
||||
@ApiProperty()
|
||||
total: number;
|
||||
}
|
||||
|
||||
export class IData {
|
||||
|
||||
Reference in New Issue
Block a user