Exemple #1
0
        public IHttpActionResult SaveAddress(SNAPME.Web.Models.Api.Account.AddressToken address)
        {
            var addressToken = new AddressToken
            {
                name     = address.name,
                line1    = address.line1,
                line2    = address.line2,
                city     = address.city,
                state    = address.state,
                zip_code = address.zip_code
            };

            if (address.idx == -1)
            {
                return(Ok(_accountService.AddAddress(User.Identity.GetUserId(), addressToken)));
            }
            else
            {
                return(Ok(_accountService.UpdateAddress(User.Identity.GetUserId(), address.idx, addressToken)));
            }
        }