Exemplo n.º 1
0
 public async Task <IActionResult> AddNoteLabel(AddNoteLabelRequest model, int NoteId)
 {
     try
     {
         if (model != null)
         {
             var userId = TokenUserId();
             if (await note.AddNoteLabel(model, userId, NoteId))
             {
                 return(Ok(new { success = true, Message = "Label added" }));
             }
             else
             {
                 return(BadRequest(new { success = false, Message = "Label did not added" }));
             }
         }
         else
         {
             return(BadRequest(new { success = false, Message = "Input should not be empty!!!" }));
         }
     }
     catch (Exception e)
     {
         return(BadRequest(new { success = false, e.Message }));
     }
 }