improved flow
This commit is contained in:
@@ -54,9 +54,6 @@ class UserBehavior(TaskSet):
|
||||
order = self.client.post('/api/payment/pay/{}'.format(uniqueid), json=cart).json()
|
||||
print('Order {}'.format(order))
|
||||
|
||||
# delete cart
|
||||
self.client.delete('/api/cart/cart/{}'.format(uniqueid))
|
||||
|
||||
|
||||
class WebsiteUser(HttpLocust):
|
||||
task_set = UserBehavior
|
||||
|
@@ -38,7 +38,9 @@ def pay(id):
|
||||
headers={'Content-Type': 'application/json'})
|
||||
app.logger.info('order history returned {}'.format(req.status_code))
|
||||
|
||||
# TDOD - order history
|
||||
# delete cart
|
||||
req = requests.delete('http://cart:8080/cart/' + id);
|
||||
app.logger.info('cart delete returned {}'.format(req.status_code))
|
||||
|
||||
return jsonify({ 'orderid': orderid })
|
||||
|
||||
|
@@ -406,14 +406,6 @@
|
||||
};
|
||||
currentUser.cart = $scope.data.cart;
|
||||
$scope.data.cont = true;
|
||||
$http({
|
||||
url: '/api/cart/cart/' + $scope.data.uniqueid,
|
||||
method: 'DELETE'
|
||||
}).then((res) => {
|
||||
console.log('cart deleted ok');
|
||||
}).catch((e) => {
|
||||
console.log('ERROR cart delete', e);
|
||||
});
|
||||
}).catch((e) => {
|
||||
console.log('ERROR', e);
|
||||
$scope.data.message = 'ERROR placing order';
|
||||
|
Reference in New Issue
Block a user