Skip to content

Commit cb6c5db

Browse files
committed
set statistics at create for nft
1 parent 7600fb4 commit cb6c5db

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/cosmos-db/documents/token/nft-details.doc.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export class NftMedia {
5757
class NftStats {
5858
@ApiProperty({ type: 'integer', required: false })
5959
likedCount?: number;
60+
61+
constructor(props?: Partial<NftStats>) {
62+
Object.assign(this, props);
63+
this.likedCount = props?.likedCount ?? 0;
64+
}
6065
}
6166

6267
class NftDocBase {
@@ -165,7 +170,7 @@ class NftDocBase {
165170
required: false,
166171
description: 'The statistics of the NFT',
167172
})
168-
statistics?: NftStats;
173+
statistics?: NftStats = new NftStats();
169174
@ApiProperty({
170175
type: Boolean,
171176
required: false,

0 commit comments

Comments
 (0)