Changeset 899b19d for resTools_backend/backend/Controllers
- Timestamp:
- 07/10/22 10:27:45 (2 years ago)
- Branches:
- master
- Children:
- a26f6a1
- Parents:
- cc4db18
- Location:
- resTools_backend/backend/Controllers
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
resTools_backend/backend/Controllers/RestaurantsController.cs
rcc4db18 r899b19d 20 20 } 21 21 22 /* 22 23 [Authorize] 23 24 [HttpPost()] … … 30 31 return Ok(); 31 32 } 33 */ 32 34 33 35 [HttpGet()] -
resTools_backend/backend/Controllers/UsersController.cs
rcc4db18 r899b19d 13 13 { 14 14 private readonly IUserService _userService = null; 15 private readonly IRestaurantService _restaurantService = null; 15 16 16 public UsersController(IUserService userService )17 public UsersController(IUserService userService, IRestaurantService restaurantService) 17 18 { 18 19 _userService = userService; 20 _restaurantService = restaurantService; 19 21 } 20 22 … … 45 47 public async Task<AuthenticateResponse> Register(CreateUserRequest req) 46 48 { 47 var response = await _userService.Register(req); 49 bool isFirst = await _restaurantService.GetRestaurant() == null; 50 var response = await _userService.Register(req, isFirst); 51 if (isFirst) 52 { 53 await _restaurantService.CreateRestaurant("", response.Id); 54 } 48 55 return response; 49 56 }
Note:
See TracChangeset
for help on using the changeset viewer.