I created the tables on the Parse Server and installed the b4a application on my Windows operating system and configured it correctly to be able to deploy it from my computer. Then I created a file with the command b4a new, and I wrote the following lines of code.
Parse.Cloud.define("create-product", async (request) => {
const stock = request.params.stock;
if(stock == null || stock > 999) throw "Quantidade inválida";
const product = new Product();
product.set("name", request.params.name);
product.set("price", request.params.price);
product.set("stock", request.params.stock);
product.set("isSelling", false);
const savedProduct = await product.save(null, {useMasterKey: true});
return savedProduct;
});
And then run the b4a deploy command to send the code to the server.
After I did that, I decided to perform the test and the result was the one below
It wasn’t supposed to cause this problem, can someone please see where I went wrong?