Advertisement
informaticage

node vinc 2

Feb 5th, 2021
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. const mapBarCodes = (variantId) => {
  3.   return new Promise((resolve, reject) => {
  4.     connection_scale.query(
  5.       "SELECT Shopify_variant_products.Barcode, varianti.cdar from Shopify_variant_products \
  6.       INNER JOIN varianti ON Shopify_variant_products.Barcode = varianti.barcode \
  7.       WHERE VariantId = ?",
  8.       [variantId],
  9.       (err, res, fields) => {
  10.         err
  11.         ? reject(err)
  12.         : resolve(err)
  13.       }
  14.     );
  15.   });
  16. };
  17.  
  18. mapBarCodes('37723929903266')
  19.   .then((result) => {
  20.     console.log(result);
  21.   })
  22.   .catch((error) => {
  23.     console.log(error);
  24.   })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement