dguglielmi-git / innovandoliving-mercadopago-cf

Mercadopago Backend Cloud Function
2 stars 0 forks source link

Backend Migration - Order Messages #9

Closed dguglielmi-git closed 1 year ago

dguglielmi-git commented 1 year ago

Verify the following code if it was replaced by the one used in mercadopago-backend-cf to get the messages related to orders:

Controller within Strapi project:

const findLastMessageId = (ctx) => {
    const { order } = ctx;
    const model = strapi.query("cart").model;
    return model.find({ order }).select({ id_message }).sort({ id_message }, -1).limit(1).exec(function (err, ord) {
        let max_order = ord[0].price;
    })
}
dguglielmi-git commented 1 year ago

It looks like it is being managed by the Mercadopago endpoints, but not by Strapi.