Exemple #1
0
        public async Task <IActionResult> EditAccountAddress(int accountId, int addressId, [FromBody] AddressEditDTO addressEditDTO)
        {
            try
            {
                var acc = await accountManager.GetAccount(accountId);

                if (acc != null)
                {
                    var address = mapper.Map <Address>(addressEditDTO);
                    var result  = await addressManager.EditAddress(addressId, address);

                    if (result == true)
                    {
                        return(NoContent());
                    }
                }

                return(BadRequest());
            }
            catch (Exception)
            {
                throw;
            }
        }