FIX: Get a total and fix owner type

This commit is contained in:
Victor Radael
2022-10-19 17:01:22 -03:00
parent 0de5e1d5d1
commit 04ea1d0f04
5 changed files with 28 additions and 24 deletions
+3 -3
View File
@@ -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({
+16 -12
View File
@@ -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 {