Skip to content

Commit

Permalink
Add search query parameter to accounts count endpoints (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfaur09 authored Jan 28, 2025
1 parent d249093 commit a13ac87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/endpoints/accounts/account.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class AccountController {
@ApiQuery({ name: 'isSmartContract', description: 'Return total smart contracts count', required: false })
@ApiQuery({ name: 'name', description: 'Filter accounts by assets name', required: false })
@ApiQuery({ name: 'tags', description: 'Filter accounts by assets tags', required: false })
@ApiQuery({ name: 'search', description: 'Search by account address, assets name', required: false })
@ApiQuery({ name: 'excludeTags', description: 'Exclude specific tags from result', required: false })
@ApiQuery({ name: 'hasAssets', description: 'Returns a list of accounts that have assets', required: false })
async getAccountsCount(
Expand All @@ -156,6 +157,7 @@ export class AccountController {
@Query("tags", ParseArrayPipe) tags?: string[],
@Query("excludeTags", ParseArrayPipe) excludeTags?: string[],
@Query("hasAssets", ParseBoolPipe) hasAssets?: boolean,
@Query("search") search?: string,
): Promise<number> {
return await this.accountService.getAccountsCount(
new AccountQueryOptions(
Expand All @@ -166,6 +168,7 @@ export class AccountController {
tags,
excludeTags,
hasAssets,
search,
}));
}

Expand All @@ -178,6 +181,7 @@ export class AccountController {
@Query("tags", ParseArrayPipe) tags?: string[],
@Query("excludeTags", ParseArrayPipe) excludeTags?: string[],
@Query("hasAssets", ParseBoolPipe) hasAssets?: boolean,
@Query("search") search?: string,
): Promise<number> {
return await this.accountService.getAccountsCount(
new AccountQueryOptions(
Expand All @@ -188,6 +192,7 @@ export class AccountController {
tags,
excludeTags,
hasAssets,
search,
}));
}

Expand Down

0 comments on commit a13ac87

Please sign in to comment.