diff --git a/src/endpoints/nfttags/tag.controller.ts b/src/endpoints/nfttags/tag.controller.ts index 69e8b9720..dc6a3a055 100644 --- a/src/endpoints/nfttags/tag.controller.ts +++ b/src/endpoints/nfttags/tag.controller.ts @@ -27,6 +27,7 @@ export class TagController { @Get("/tags/count") @ApiOperation({ summary: 'Total number of NFT Tags', description: 'Returns total number of distinct NFT Tags available on blockchain' }) + @ApiQuery({ name: 'search', description: 'Search by tag name', required: false }) @ApiOkResponse({ type: Number }) async getTagCount( @Query('search') search: string | undefined, diff --git a/src/endpoints/nfttags/tag.service.ts b/src/endpoints/nfttags/tag.service.ts index 769cacae5..9685c8f32 100644 --- a/src/endpoints/nfttags/tag.service.ts +++ b/src/endpoints/nfttags/tag.service.ts @@ -61,21 +61,12 @@ export class TagService { const result = await this.elasticService.getList('tags', 'tag', elasticQuery); - const nftTags: Tag[] = result.map(item => ApiUtils.mergeObjects(new Tag(), item)); - - for (const tag of nftTags) { - tag.tag = BinaryUtils.base64Decode(tag.tag); - } - - return nftTags; + return result.map(item => ApiUtils.mergeObjects(new Tag(), item)); } async getNftTag(tag: string): Promise { const result = await this.elasticService.getItem('tags', 'tag', BinaryUtils.base64Encode(tag)); - const nftTag = ApiUtils.mergeObjects(new Tag(), result); - nftTag.tag = BinaryUtils.base64Decode(nftTag.tag); - - return nftTag; + return ApiUtils.mergeObjects(new Tag(), result); } }