예제 #1
0
 public async Task <IActionResult> EditNote(int noteId, EditNoteRequestModel model)
 {
     if (noteId != 0 && (model.Message != null || model.Title != null))
     {
         var userId = TokenUserId();
         if (await note.EditNote(noteId, model, userId))
         {
             string status = "Note edited";
             return(Ok(new { status, userId, model }));
         }
         else
         {
             string status = "Note did not edited";
             return(BadRequest(new { status, userId, model }));
         }
     }
     else
     {
         return(BadRequest(new { success = false, Meassage = "Input should not be empty!!!" }));
     }
 }