diff --git a/src/a3.nim b/src/a3.nim index 20b1aa6..f4de7e1 100644 --- a/src/a3.nim +++ b/src/a3.nim @@ -88,8 +88,6 @@ import password: string db = newDatabase() products: seq[Products] - form = ctx.urlForm - echo form try: email = ctx.cookies["email"] @@ -108,17 +106,10 @@ import cart = db.getUserCart(userId) cook = ctx.cookies - # echo cart - # echo cook - # db.updateCart(cook) - for d, e in cook: if d.contains("_quantity") == true: var h = d.split("_") - echo h for i, j in cart: - # echo i - # echo j if j.productId == parseInt(h[0]): db.updateCart(e, j.id) diff --git a/src/a3c/cart.nim b/src/a3c/cart.nim index 141ce52..e95a128 100644 --- a/src/a3c/cart.nim +++ b/src/a3c/cart.nim @@ -52,20 +52,4 @@ proc removeFromCart*(db: DbConn, cart: Cart) = db.exec(sql"DELETE FROM cart WHERE user_id=? AND product_id=?", cart.userId, cart.productId) proc updateCart*(db: DbConn, quantity: string, id: int) = - # echo id - # echo quantity - # echo userId - # echo db.getAllRows(sql"SELECT * FROM cart WHERE user_id=? AND product_id=?;", userId, parseInt(productId)) - db.exec(sql"UPDATE cart SET quantity=? WHERE id=?", quantity, id) - -# proc updateCart*(db: DbConn, cookies: StringTableRef) = -# echo cookies - -# for d, e in cookies: -# if d.contains("_quantity") == true: -# var h = d.split("_") -# echo h - -# db.exec(sql"UPDATE cart SET quantity=? WHERE id=?", e, h[0]) -# echo parseInt(h[0]) -# echo parseInt(e) \ No newline at end of file + db.exec(sql"UPDATE cart SET quantity=? WHERE id=?", quantity, id) \ No newline at end of file diff --git a/src/dd b/src/dd deleted file mode 100755 index c5a7535..0000000 Binary files a/src/dd and /dev/null differ diff --git a/src/dd.nim b/src/dd.nim deleted file mode 100644 index a706a15..0000000 --- a/src/dd.nim +++ /dev/null @@ -1,6 +0,0 @@ -import strformat - -var i = @['o', 'p', 'r'] -echo i -for q, w in i: - echo fmt"q: {q}, w: {w}" \ No newline at end of file