Skip to content

Commit

Permalink
feat(sign-up): consent request management
Browse files Browse the repository at this point in the history
ref: MANAGER-11426

Signed-off-by: Jacques Larique <[email protected]>
  • Loading branch information
Jacques Larique committed Jul 27, 2023
1 parent 4c905b1 commit 3cd8934
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
27 changes: 13 additions & 14 deletions packages/manager/apps/sign-up/src/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,19 @@ export const state = {
me,
signUp,
) => (smsConsent) =>
signUp.saveNic(me.model).then(() => {
if (smsConsent) {
signUp.giveSmsConsent();
}
// for tracking purposes
if ($window.sessionStorage) {
$window.sessionStorage.setItem('ovhSessionSuccess', true);
}
// manage redirection
const redirectUrl = getRedirectLocation(me.nichandle);
if (redirectUrl) {
$window.location.assign(redirectUrl);
}
}),
signUp.saveNic(me.model).then(() =>
signUp.sendSmsConsent(smsConsent).then(() => {
// for tracking purposes
if ($window.sessionStorage) {
$window.sessionStorage.setItem('ovhSessionSuccess', true);
}
// manage redirection
const redirectUrl = getRedirectLocation(me.nichandle);
if (redirectUrl) {
$window.location.assign(redirectUrl);
}
}),
),

steps: () => [
{
Expand Down
12 changes: 6 additions & 6 deletions packages/manager/modules/sign-up/src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export default class SignUpService {
return this.$http.put('/me', nicInfos);
}

giveSmsConsent() {
sendSmsConsent(consent = false) {
return this.$http.put('/me/marketing', {
denyAll: false,
denyAll: consent !== true,
sms: {
events: true,
newProductRecommendation: true,
newsletter: true,
offerAndDiscount: true,
events: consent,
newProductRecommendation: consent,
newsletter: consent,
offerAndDiscount: consent,
},
});
}
Expand Down

0 comments on commit 3cd8934

Please sign in to comment.