Help me TotalOwnedItemUri

I want to add a function to the contract that will return the token uri of all the total owned items. but I couldn't manage. Could you please help me on this? All help will be appreciated.

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.3;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

import "hardhat/console.sol";

contract NFT is ERC721URIStorage {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;
    address contractAddress;

    constructor(address marketplaceAddress) ERC721("Metaverse", "METT") {
        contractAddress = marketplaceAddress;
    }

    function createToken(string memory tokenURI) public returns (uint) {
        _tokenIds.increment();
        uint256 newItemId = _tokenIds.current();

        _mint(msg.sender, newItemId);
        _setTokenURI(newItemId, tokenURI);
        setApprovalForAll(contractAddress, true);
        return newItemId;
    }
}

normally this should work

  event AddTokenUri(string tokenURI)
    struct AllOwnedNft{
        string tokenURI
    }
    AllOwnedNft[] public allOwnedNft;
    
    mapping(address => mapping(uint => string)) public TotalUri;
..............................
........................
 

shouldn't a structure like this actually give me what I want?

Yes, you can store the URIs in an array, and you can return that array from a function, but this will fail at some point if your array is too big.

It will cause problems after a certain period of time. My goal is for each user to reach their own product list. In this way, I can list the pictures via Uri. What is your solution suggestion for this issue? :smirk:

Sorry, I don't understand the issue.