public IActionResult Delete(int id)
 {
     try
     {
         return(Ok(labelService.DeleteLabel(id)));
     }
     catch (Exception e)
     {
         return(NotFound(e.Message));
     }
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var labelUid = id;

            if (labelUid.IsEmptyGuid())
            {
                return(Forbid());
            }

            var request  = new LabelDeleteRequest(CurrentUser.Id, labelUid);
            var response = await _labelService.DeleteLabel(request);

            if (response.Status.IsNotSuccess)
            {
                return(Json(new CommonResult {
                    IsOk = false, Messages = response.ErrorMessages
                }));
            }

            CurrentUser.IsActionSucceed = true;
            return(Json(new CommonResult {
                IsOk = true
            }));
        }
Exemplo n.º 3
0
        public async Task <ActionResult <Label> > DeleteLabel(long id)
        {
            await _labelService.DeleteLabel(id);

            return(NoContent());
        }
Exemplo n.º 4
0
 public SuccessResponse <string> DeleteLabel(Guid id)
 {
     _labelService.DeleteLabel(id);
     return(new SuccessResponse <string>("success"));
 }
 /// <summary>
 /// Deletes the label.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <returns></returns>
 public int DeleteLabel(int id)
 {
     return(_labelService.DeleteLabel(id));
 }
Exemplo n.º 6
0
 public ActionResult <int> DeleteLabel(int id)
 {
     _logger.Info(() => "Api DeleteLabel");
     return(StatusCode((int)HttpStatusCode.OK, _labelService.DeleteLabel(id)));
 }