public async Task <IActionResult> AcceptTerms() { Guid userId = GetUserId(); string language = Request.GetCurrentLanguage(); TermsWithContent newestTerms = await GetNewestTerms(userId, language); await TermsService.MarkReadAsync(newestTerms.Id, userId.ToString(), language); //Clear cache so we get the updated boolean that the user has read the terms Cache.Remove($"terms-{language}-{userId}"); return(RedirectToAction("index", new { lang = language })); }
public async Task <IActionResult> Index() { Guid userId = GetUserId(); TermsWithContent newestTerms = await GetNewestTerms(userId, Request.GetCurrentLanguage()); DataMetaWrapper <Translation> translations = await GetTranslations(); var viewModel = new TermsViewModel { Content = newestTerms.Content.Data, HasApproved = newestTerms.HasViewed, Headline = translations.Data.Terms.Headline, ApproveButton = translations.Data.Terms.Approve, HasApprovedString = translations.Data.Terms.HasApproved }; return(View(viewModel)); }