Rarible Clone Own items also displaying on list of items for sale


In the tutorial, the cloud code includes this piece of code in the getItems function. I have this in my code too but when I load the list of items for sale, the account’s own item is also getting displayed yet it shouldn’t based on this section:

  if (request.user) {
    query.notContainedIn("token.owner_of", request.user.attributes.accounts);

What might be the issue? Thanks

Edit: I have followed the tutorial and moved the filtering to frontend but it still displays the user’s own items. I have checked the attributes and they seem correct. So the user returned ahs the ownerOf of the item in its accounts array. However, the issue persists.

1 Like

Not sure if it helps, here should be the cloud functions from that tutorial: https://github.com/MoralisWeb3/youtube-tutorials/blob/main/rarible-clone/cloud_functions.js

1 Like

I have the same code in my cloud functions as well.

In getItems cloud function I see a for loop that iterates over all the items, you could skip there what you want to skip.