Skip to content

Commit

Permalink
fixed tag display (#671)
Browse files Browse the repository at this point in the history
* fixed tag display

* do not perform tag processing
  • Loading branch information
tanghel authored Jun 8, 2022
1 parent e2f913c commit 4ece51b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/endpoints/nfttags/tag.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 2 additions & 11 deletions src/endpoints/nfttags/tag.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tag> {
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);
}
}

0 comments on commit 4ece51b

Please sign in to comment.