Rarible Clone Part 5/7 - Missing ParseObjectSubclass Data

I am able to mint an item, however, I seem to be missing information from Attributes: Object, more specifically, the name, description, nftFilePath, nftFileHash, metadataFilePath, metadataFileHash, nftId, nftContractAddress.

createItem = async () => {
    if (createItemFile.files.length == 0) {
        alert("Please select a file");
        return;
    } else if (createItemNameField.value.length == 0) {
        alert("Please give the item a name");
        return;
    }

    const nftFile = new Moralis.File("nftFile.jpg",createItemFile.files[0]);
    await nftFile.saveIPFS();

    const nftFilePath = nftFile.ipfs();
    const nftFileHash = nftFile.hash();

    const metadata = {
        name: createItemNameField.value,
        description: createItemDescriptionField.value,
        image: nftFilePath
    };

    const nftFileMetadataFile = new Moralis.File("metadata.json", {base64 : btoa(JSON.stringify(metadata))});
    await nftFileMetadataFile.saveIPFS();

    const nftFileMetadataFilePath = nftFileMetadataFile.ipfs();
    const nftFileMetadataFileHash = nftFileMetadataFile.hash();

    const nftId = await mintNft(nftFileMetadataFilePath);

    let Item = Moralis.Object.extend("Item");

    let item = new Item();
    item.set('name', createItemNameField.value);
    item.set('description', createItemDescriptionField.value);
    item.set('nftFilePath', nftFilePath);
    item.set('nftFileHash', nftFileHash);
    item.set('metadataFilePath', nftFileMetadataFilePath);
    item.set('metadataFileHash', nftFileMetadataFileHash);
    item.set('nftId', nftId);
    item.set('nftContractAddress', TOKEN_CONTRACT_ADDRESS);
    await item.save();
    console.log(item);
}

Thank you in advance

1 Like

I think it should be there, in the objects properties, might be that you are looking in the wrong property.

Carlos Z

1 Like

I had hoped that that were the case. However, I continued on with the tutorial and in part 8, where we are supposed to see the data in our cloud functions, I am missing that as well. The first image is from my console, the second is the tutorial’s.
Screen Shot 2021-06-10 at 5.15.11 PM


I am assuming that there aren’t any console settings to be adjusted, and I have checked to make sure I have the most up to date SDK.

You probably have a syntax error some where in your code.

Please follow this guidelines, if none of the items help you, at the end you should follow the guide to post code and share your project properly to check where is the syntax error

Also I advice you to check your Cloud Function :face_with_monocle:

Carlos Z

Yes it in fact was a syntax error, a missing comma in the cloud function. Thank you