Exemple #1
0
        public async Task <IActionResult> AddStringEntry(AddStringEntry vm)
        {
            var userId = GetUserId();
            await _entryService.AddReplaceCharacterStringEntryAsync(vm.StringEntryType, GetUserId(), vm.CharacterId, vm.Text);

            var sections = await _characterService.GetSectionsAsync(vm.CharacterId, userId);

            return(new JsonResult(sections));
        }
Exemple #2
0
        public async Task <IActionResult> AddStringEntry(CharacterStringEntryType entryType, int id, string text)
        {
            var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);

            if (!string.IsNullOrWhiteSpace(text))
            {
                await _entryService.AddReplaceCharacterStringEntryAsync(entryType, userId, id, text);
            }

            return(RedirectToAction("Index", new { id = id }));
        }