public void EditNote(EditNoteReq noteIn, string email) { DateTime saveUtcNow = DateTime.UtcNow; NoteMod note = new NoteMod(noteIn.note_id, saveUtcNow, email, noteIn.Title, noteIn.Note); _notes.ReplaceOne(note => note.Id == noteIn.note_id && note.Email == email, note); }
public ActionResult EditNoteJson([FromBody] EditNoteReq model) { ClaimsIdentity claimsIdentity = User.Identity as ClaimsIdentity; var email = claimsIdentity.FindFirst("user_email").Value; _noteService.EditNote(model, email); return(Ok(new { msg = "Note successfully edited!", status = "success" })); }