- risolto problema spazi vuoti in cima alla app
- risolto problema sulle card di telegram, immagini non alte uguali e non si vedono bene...
This commit is contained in:
@@ -36,17 +36,17 @@ const OrdersCart = require('../models/orderscart');
|
||||
|
||||
//GET cart
|
||||
router.get('/:userId', authenticate, async function (req, res, next) {
|
||||
let userId = req.params.userId;
|
||||
let idapp = req.user.idapp;
|
||||
return await Cart.getCartByUserId(userId, idapp)
|
||||
.then((cart) => {
|
||||
if (cart) return res.send({ code: server_constants.RIS_CODE_OK, cart });
|
||||
else return res.send({ code: server_constants.RIS_CODE_OK, cart: null });
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Err', err);
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: null });
|
||||
});
|
||||
try {
|
||||
let userId = req.params.userId;
|
||||
let idapp = req.user.idapp;
|
||||
|
||||
const cart = await Cart.getCartByUserId(userId, idapp);
|
||||
if (cart) return res.send({ code: server_constants.RIS_CODE_OK, cart });
|
||||
else return res.send({ code: server_constants.RIS_CODE_OK, cart: null });
|
||||
} catch (err) {
|
||||
console.error('Err', err);
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: null });
|
||||
}
|
||||
});
|
||||
|
||||
async function aggiornaCarrello(mycartpar, userId, idapp) {
|
||||
@@ -71,13 +71,13 @@ async function aggiornaCarrello(mycartpar, userId, idapp) {
|
||||
|
||||
//POST cart
|
||||
router.post('/:userId', authenticate, async function (req, res, next) {
|
||||
let idapp = req.body.idapp;
|
||||
let userId = req.params.userId;
|
||||
let addqty = req.body.addqty;
|
||||
let subqty = req.body.subqty;
|
||||
let order = req.body.order;
|
||||
|
||||
try {
|
||||
let idapp = req.body.idapp;
|
||||
let userId = req.params.userId;
|
||||
let addqty = req.body.addqty;
|
||||
let subqty = req.body.subqty;
|
||||
let order = req.body.order;
|
||||
|
||||
let mycart = await Cart.getCartByUserId(userId, idapp);
|
||||
|
||||
if (!order) {
|
||||
|
||||
Reference in New Issue
Block a user