diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-09-29 02:32:56 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-09-29 02:32:56 +0000 |
| commit | 78f205302c35cab2512971d64c8152aab2dcfa95 (patch) | |
| tree | 72be75ad949fe9efaf7b55c8f7f5722225538b28 /indoteknik_api/controllers | |
| parent | 50b5bd7bd984ef108e8bd324440050a222d8262f (diff) | |
| parent | 0bb47005022b33c79ecfb5924d41f35ce794c5fb (diff) | |
Merged in production (pull request #126)
Production
Diffstat (limited to 'indoteknik_api/controllers')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/cart.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/cart.py b/indoteknik_api/controllers/api_v1/cart.py index 2243ec0f..cb0f5a99 100644 --- a/indoteknik_api/controllers/api_v1/cart.py +++ b/indoteknik_api/controllers/api_v1/cart.py @@ -101,4 +101,17 @@ class Cart(controller.Controller): query += [('product_id', 'in', [int(x) for x in product_ids.split(',')])] cart = request.env['website.user.cart'].search(query).unlink() return self.response(cart) + + @http.route(PREFIX_USER + 'cart/select-all', auth='public', methods=['POST', 'OPTIONS'], csrf=False) + @controller.Controller.must_authorized(private=True, private_key='user_id') + def select_all_cart_by_user_id(self, user_id): + user_id = int(user_id) + + website_user_cart = request.env['website.user.cart'] + query = [('user_id', '=', user_id)] + website_user_cart.search(query).write({ + 'is_selected': True + }) + + return self.response(True)
\ No newline at end of file |
