Skip to content

Commit 34a4854

Browse files
committed
Merge branch 'cart-feature' of https://github.com/damienmoulard/Zenergy.git
2 parents cb3e62d + 8a07b30 commit 34a4854

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Zenergy/Zenergy/Controllers/ApiControllers/CartContentsController.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,18 @@ public async Task<IHttpActionResult> ValidateBasket(int userId, CartContent cart
163163
purchaseContents.Add(purchaseContent);
164164
}
165165

166-
var purchase = db.purchase.Add(new purchase() { userId = cartContent.userId, purchaseDate = DateTime.Today, user = cartContent.user, purchaseContent = purchaseContents });
166+
var purchase = db.purchase.Add(new purchase() { userId = cartContent.userId, purchaseDate = DateTime.Today, user = cartContent.user, purchaseContent = purchaseContents });
167167

168-
try
169-
{
170-
//Clearing the basket
171-
await ClearBasket(basket.ToListAsync().Result);
172-
}
173-
catch (DbUpdateException)
174-
{
175-
throw;
168+
try
169+
{
170+
//Clearing the basket
171+
await ClearBasket(basket.ToListAsync().Result);
172+
}
173+
catch (DbUpdateException)
174+
{
175+
throw;
176+
}
176177
}
177-
178178
return Created("api/users/{userId}/basket/validate", purchase);
179179
}
180180

0 commit comments

Comments
 (0)