Beispiel #1
0
        public IActionResult GiveALike(int skateboardId)
        {
            ProfileController profileController = new ProfileController(_dbService);
            int currentUserId = profileController.GetCurrentUser().UserId;

            if (checkLike(skateboardId, currentUserId).Equals(false))
            {
                return(RedirectToAction("Skateboards"));
            }
            else
            {
                _dbService.GiveALike(currentUserId, skateboardId);
                return(RedirectToAction("Skateboards"));
            }
        }
Beispiel #2
0
        public List <Skateboard> GetUserSkateboards()
        {
            ProfileController profileController = new ProfileController(_dbService);

            return(_dbService.GetUserSkateboards(profileController.GetCurrentUser().UserId));
        }