[HttpPost("{studyId}")]
public async Task<ActionResult<NoteDTO>> CreateNote(int studyId, [FromBody] CreateNoteInput input)
{
Note newNote = new Note
{...};
_context.Notes.Add(newNote);
await _context.SaveChangesAsync();
var createdNoteDTO = new NoteDTO
{...};
return CreatedAtAction(nameof(CreateNote), new { id = newNote.Id }, createdNoteDTO);
}
[HttpPost("{studyId}")]
public async Task<ActionResult<NoteDTO>> CreateNote(int studyId, [FromBody] CreateNoteInput input)
{
Note newNote = new Note
{...};
_context.Notes.Add(newNote);
await _context.SaveChangesAsync();
var createdNoteDTO = new NoteDTO
{...};
return CreatedAtAction(nameof(CreateNote), new { id = newNote.Id }, createdNoteDTO);
}