Ejemplo n.º 1
0
        public async Task <IActionResult> SetCancel([FromRoute] int id, [FromBody] string reason)
        {
            try
            {
                VerifyUser();
                if (string.IsNullOrWhiteSpace(reason) || string.IsNullOrEmpty(reason))
                {
                    var Result = new
                    {
                        error      = "Alasan harus diisi.",
                        apiVersion = "1.0.0",
                        statusCode = HttpStatusCode.BadRequest,
                        message    = "Data does not pass validation"
                    };

                    return(new BadRequestObjectResult(Result));
                }
                await _service.SetStatus(id, GarmentPackingListStatusEnum.CANCELED, reason);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
        public async Task <IActionResult> SetCancel([FromRoute] int id, [FromBody] string reason)
        {
            try
            {
                VerifyUser();
                await _service.SetStatus(id, GarmentPackingListStatusEnum.CANCELED, reason);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }