Problem with patching a listing

Hello guys I am using the above code to update a price of a listing

      let query = {
          price:100 * item['cheaper']['price'] // price in cents
      };

      await gfapi.listing_patch(id, query).catch(err => {
        console.log("Update Error:" + err)
      });

but I am getting the above errors
Update Error:InternalServerError: no implicit conversion of String into Integer
Update Error:InternalServerError: no implicit conversion of String into Integer
Update Error:InternalServerError: no implicit conversion of String into Integer

1 Like

cat anyone help me on this?

item['cheaper']['price'] is probably a string and you’re multiplying 100 with it.

No it does not, it is a float the problem occurs as it seems in server not in client

The patch’s query has to be like index.js listing_status() format:

let query = [{
    op: 'replace',
    path: '/price',
    value: 100 * item['cheaper']['price'] // price in cents
}];

await gfapi.listing_patch(id, query).catch(err => {
    console.log("Update Error:" + err)
});

YES correct galaticarm it worked you must first set on READY status the listing cause you can not change listing price when is on sale…