Exemplo n.º 1
0
        public async Task <IActionResult> Like(ViewChapterViewModel model)
        {
            var author = await userManager.FindByNameAsync(User.Identity.Name);

            if (!fanficService.IsLiked(author, model.ChapterNumber, model.FanficId))
            {
                fanficService.CreateLike(author, model.ChapterNumber, model.FanficId);
            }
            return(Redirect("/Fanfic/ViewChapter/?fanficId=" + model.FanficId + "&number=" + model.ChapterNumber));
        }