Ignore:
Timestamp:
07/10/22 10:27:45 (2 years ago)
Author:
Danilo <danilo.najkov@…>
Branches:
master
Children:
a26f6a1
Parents:
cc4db18
Message:

reviews full feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • resTools_backend/backend/Controllers/UsersController.cs

    rcc4db18 r899b19d  
    1313{
    1414    private readonly IUserService _userService = null;
     15    private readonly IRestaurantService _restaurantService = null;
    1516
    16     public UsersController(IUserService userService)
     17    public UsersController(IUserService userService, IRestaurantService restaurantService)
    1718    {
    1819        _userService = userService;
     20        _restaurantService = restaurantService;
    1921    }
    2022
     
    4547    public async Task<AuthenticateResponse> Register(CreateUserRequest req)
    4648    {
    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        }
    4855        return response;
    4956    }
Note: See TracChangeset for help on using the changeset viewer.