Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Controllers/ReviewsController.cs
r49b0bbd r13f1472 12 12 { 13 13 private readonly IReviewService _reviewService = null; 14 private readonly IUserService _userService = null; 14 15 15 public ReviewsController(IReviewService reviewService )16 public ReviewsController(IReviewService reviewService, IUserService userService) 16 17 { 17 18 _reviewService = reviewService; 19 _userService = userService; 18 20 } 19 21 … … 39 41 userId = (int)this.HttpContext.Items["User"]; 40 42 } 41 catch (Exception ex) { return null; } 43 catch (Exception ex) { 44 var user = await _userService.GetByEmail((string)this.HttpContext.Items["User"]); 45 if (user == null) 46 { 47 return null; 48 } 49 userId = user.Id; 50 } 42 51 await _reviewService.AddReview(req, userId); 43 52 return Ok();
Note:
See TracChangeset
for help on using the changeset viewer.