Ejemplo n.º 1
0
        public async Task <IActionResult> AddFavoriteDish(int dishId)
        {
            var loggedUser = User.GetUserIdFromToken();
            var result     = await _dishService.AddFavoriteDishAsync(loggedUser, dishId);

            var language = await _userService.GetUserLanguageFromUserIdAsync(loggedUser);

            var mapped = _mapper.Map <DishResponse>(result, opt =>
            {
                opt.Items["lang"] = language;
            });

            return(Created("", new ApiOkResponse(mapped)));
        }