public async Task <IActionResult> Index()
        {
            var userId = GetUserId();

            ViewBag.UserInfo = new UserInfoModel()
            {
                UserMail = Request.Cookies.FirstOrDefault(t => t.Key == "userName").Value,
                UserId   = Request.Cookies.FirstOrDefault(t => t.Key == "userId").Value
            };

            if (userId > 0)
            {
                ViewBag.Types       = JsonConvert.SerializeObject(await loveCollectionAppService.GetAllTypeAsync(userId));
                ViewBag.Collections = JsonConvert.SerializeObject(await loveCollectionAppService.GetAllCollectionAsync(userId));
            }
            return(View());
        }
Exemple #2
0
        public async Task <List <TypesOutput> > GetTypes(string userToken = null)
        {
            var userId = GetUserId(userToken);

            return(await loveCollectionAppService.GetAllTypeAsync(userId));
        }