diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-16 11:08:21 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-16 11:08:21 +0700 |
| commit | 12c821732b31ff68dec7e0a7a8390466b4181692 (patch) | |
| tree | f404c025ea9596de89a72cdeab2512d17e92a1ac /indoteknik_api/controllers/api_v1/cart.py | |
| parent | bc6bc85f455c4b8bc9f73b779b521faa5fcdcf96 (diff) | |
Fix add to cart api
Diffstat (limited to 'indoteknik_api/controllers/api_v1/cart.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/cart.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/cart.py b/indoteknik_api/controllers/api_v1/cart.py index 0d54ecbc..002b7442 100644 --- a/indoteknik_api/controllers/api_v1/cart.py +++ b/indoteknik_api/controllers/api_v1/cart.py @@ -27,9 +27,11 @@ class Cart(controller.Controller): user_id = int(user_id) product_id = int(kw.get('product_id', 0)) qty = int(kw.get('qty', 0)) - is_selected = int(kw.get('is_selected', False)) + is_selected = kw.get('selected', False) program_line_id = int(kw.get('program_line_id', False)) + if is_selected: + is_selected = True if is_selected == 'true' else False if not user_id or not product_id or not qty: return self.response(code=400, description='user_id, product_id and qty is required') query = [('user_id', '=', user_id), ('product_id', '=', product_id)] |
