예제 #1
0
        public ActionResult UpdateStatus([FromServices] ICacheHelper cache, int id, UpdateOrderDTO input)
        {
            if (!ModelState.IsValid || id <= 0)
            {
                return(BadRequest());
            }
            var re = _orderModel.UpdateStatus(id, (byte)(input.status));

            if (!re)
            {
                return(Problem(statusCode: 500, detail: "Can't update status data"));
            }
            if (input.status == 0)
            {
                cache.DataUpdated(CacheKey.PRODUCT);
            }

            return(Ok());
        }