public async Task <IHttpActionResult> PostNote(NoteDto newNote) { ServiceResponse <GetNoteDto> response = await _noteService.AddNewNote(newNote); if (response.Success) { return(Ok(response)); } return(Ok(response)); }
public async Task <IActionResult> CreateNote([FromBody] AddNewNoteRequest newNote) { var result = await _noteService.AddNewNote(newNote); if (!result) { return(BadRequest()); } return(Ok()); }
public async Task <IActionResult> AddNote([FromBody] AddNoteViewModel model) { if (!ModelState.IsValid) { return(BadRequest()); } await _noteService.AddNewNote(model); return(CreatedAtAction("GetNotes", new { id = model.NoteId })); }