Ejemplo n.º 1
0
        public async Task <IActionResult> PutAsync(int id, [FromBody] CodeInputModel value)
        {
            if (value == null)
            {
                return(BadRequest("Invalid input"));
            }

            var result = await _codesService.UpdateAsync(id, value);

            if (result == null)
            {
                return(BadRequest($"Update of code {id} failed"));
            }

            return(Ok(result));
        }