Skip to content

Commit 5f985ad

Browse files
Merge pull request #1580 from multiversx/fix-nft-attributes-source
fix nft attributes source
2 parents f7c3c8d + dc044aa commit 5f985ad

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/endpoints/nfts/nft.service.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,20 @@ export class NftService {
324324
return;
325325
}
326326

327-
const nftsForAddress = await this.esdtAddressService.getNftsForAddress(nft.owner, new NftFilter({ identifiers: [nft.identifier] }), new QueryPagination({ from: 0, size: 1 }));
328-
if (nftsForAddress.length === 0) {
329-
return;
327+
let attributes = nft.attributes;
328+
if (!attributes || attributes.length === 0) {
329+
const nftsForAddress = await this.esdtAddressService.getNftsForAddress(nft.owner, new NftFilter({identifiers: [nft.identifier]}), new QueryPagination({
330+
from: 0,
331+
size: 1,
332+
}));
333+
if (nftsForAddress.length === 0) {
334+
return;
335+
}
336+
337+
attributes = nftsForAddress[0].attributes;
330338
}
331339

332-
nft.attributes = nftsForAddress[0].attributes;
340+
nft.attributes = attributes;
333341
}
334342

335343
private async applyMedia(nft: Nft) {

src/endpoints/process-nfts/process.nfts.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export class ProcessNftsService {
9797
}
9898

9999
private async isCollectionOwner(address: string, collection: string): Promise<boolean> {
100+
if (this.apiConfigService.getSecurityAdmins().includes(address)) {
101+
return true;
102+
}
100103
const collectionOwner = await this.getCollectionNonScOwner(collection);
101104

102105
return address === collectionOwner;

0 commit comments

Comments
 (0)