PatrickAlphaC / nextjs-nft-marketplace-moralis-fcc

44 stars 50 forks source link

Incorrect order of getLogger and logger.info in cloud functions #18

Open adityabhattad2021 opened 2 years ago

adityabhattad2021 commented 2 years ago

Here is the relevant code snippet from cloudFunctions.js

Moralis.Cloud.afterSave("ItemCanceled", async (request) => {
    const confirmed = request.object.get("confirmed")
    logger.info(`Marketplace | Object: ${request.object}`)
    if (confirmed) {
        const logger = Moralis.Cloud.getLogger()
        const ActiveItem = Moralis.Object.extend("ActiveItem")
        const query = new Moralis.Query(ActiveItem)