Ejemplo n.º 1
0
        public IHttpActionResult SetOptIns(SetOptInsRequest request)
        {
            var newsletterUpdated = SetNewsletterUserOptInsContext.Set(request?.Newsletters?.Where(w => w.NewsletterChecked).Select(s => s.PublicationCode).ToList() ?? Enumerable.Empty <string>());
            var offersUpdated     = OffersOptIn.Update(!request.Offers);

            return(Ok(new
            {
                success = newsletterUpdated && offersUpdated
            }));
        }
Ejemplo n.º 2
0
        public IHttpActionResult Update(PreferencesRequest request)
        {
            var newsletterUpdated = SetNewsletterUserOptInsContext.Set(request.Publications ?? Enumerable.Empty <string>());
            var offersUpdated     = OffersOptIn.Update(!request.DoNotSendOffersOptIn);

            return(Ok(new
            {
                success = newsletterUpdated && offersUpdated
            }));
        }