Skip to content

Commit

Permalink
fix: Add left join to add assetAccounts field.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanguoyu committed Oct 19, 2023
1 parent f542b29 commit f4fa8b6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/neuron-wallet/src/services/sudt-token-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ export default class SudtTokenInfoService {
.execute()
}

static getSudtTokenInfo(tokenID: string) {
return getConnection().getRepository(SudtTokenInfoEntity).findOne({
tokenID,
})
static getSudtTokenInfo(typeArgs: string): Promise<SudtTokenInfoEntity | undefined> {
return getConnection()
.getRepository(SudtTokenInfoEntity)
.createQueryBuilder('info')
.leftJoinAndSelect('info.assetAccounts', 'aa')
.where(`info.tokenID = :typeArgs`, {
typeArgs,
})
.getOne()
}
}

0 comments on commit f4fa8b6

Please sign in to comment.