Skip to content

Commit

Permalink
Merge pull request #205 from UniqueNetwork/fix/v1.7.7-tokens-webapi
Browse files Browse the repository at this point in the history
query tokens with bundle
  • Loading branch information
icehuntmen committed Feb 17, 2023
2 parents 494b801 + d50d0ae commit e39f8d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions apps/web-api/src/tokens/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class TokenService extends BaseService<Tokens, TokenDTO> {
): Promise<IDataListResponse<TokenDTO>> {
const qb = this.repo.createQueryBuilder();

qb.andWhere('"TokenOwners"."parent_id" is null');
qb.andWhere('parent_id is null');
qb.andWhere(`nested = :nested`, { nested: true });

this.applyArgs(qb, queryArgs, queryInfo);
Expand All @@ -96,15 +96,15 @@ export class TokenService extends BaseService<Tokens, TokenDTO> {

qb.where(
new Brackets((qb) => {
qb.where('"TokenOwners"."parent_id" is null').andWhere(
qb.where('parent_id is null').andWhere(
`children @> '[{"token_id": ${token_id}, "collection_id": ${collection_id}}]'::jsonb`,
);
}),
);

qb.orWhere(
new Brackets((qb) => {
qb.where('"TokenOwners"."parent_id" is null')
qb.where('parent_id is null')
.andWhere('"Tokens".token_id = :token_id', {
token_id,
})
Expand Down Expand Up @@ -158,7 +158,7 @@ export class TokenService extends BaseService<Tokens, TokenDTO> {
const qb = this.repo.createQueryBuilder();

const parentCredentials = `${collection_id}_${token_id}`;
qb.where('"TokenOwners"."parent_id" = :parentCredentials', {
qb.where('parent_id = :parentCredentials', {
parentCredentials,
});
//qb.andWhere('Tokens.burned = false');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polkastats-backend-uniquenetwork",
"version": "1.7.6",
"version": "1.7.7",
"description": "",
"author": "Unique Network Team",
"private": true,
Expand Down

0 comments on commit e39f8d7

Please sign in to comment.