public async Task <IActionResult> Create([FromBody] CreateLogNoteModel model) { try { var user = await GetLoggedInUser(); await _logNoteService.Create(user.Id.Value, model); return(Ok()); } catch (Exception e) { return(HandleException(e)); } }
public async Task <IActionResult> Create([FromBody] CreateLogNoteModel model) { return(await ProcessAsync(async() => { var logNote = new LogNoteModel { StudentId = model.StudentId, TypeId = model.TypeId, Message = model.Message }; var author = await UserService.GetUserByPrincipal(User); logNote.CreatedById = author.Id; logNote.UpdatedById = author.Id; await _logNoteService.Create(logNote); return Ok("Log note created successfully."); }, Permissions.Student.StudentLogNotes.EditLogNotes)); }