File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const renderForm = (viewModel: ViewModel) =>
1919 pipe (
2020 html `
2121 < h1 > Change primary email</ h1 >
22- < form action ="?next=/me " method ="post ">
22+ < form action ="?next=/member/ ${ viewModel . memberNumber } " method ="post ">
2323 < label for ="email "> Email address</ label >
2424 < input
2525 type ="email "
Original file line number Diff line number Diff line change @@ -13,17 +13,24 @@ type ViewModel = {
1313 user : User ;
1414 memberNumber : number ;
1515 emailAddress : string ;
16+ isSelf : boolean ;
1617} ;
1718
1819const renderForm = ( viewModel : ViewModel ) =>
1920 pipe (
20- html `
21+ viewModel . isSelf
22+ ? html `< p >
23+ In order to finish adding an email to your profile it needs to be verified. Click the button below
24+ to send an email with a verification link to '${ sanitizeString ( viewModel . emailAddress ) } '
25+ </ p > `
26+ : html `< p >
27+ In order to finish adding an email to this profile (member number ${ viewModel . memberNumber } ) it needs to be verified.
28+ Click the button below to send an email with a verification link to '${ sanitizeString ( viewModel . emailAddress ) } '
29+ </ p > ` ,
30+ ( description ) => html `
2131 < h1 > Send email verification</ h1 >
22- < p >
23- In order to finish adding an email to your profile it needs to be verified. Click the button below
24- to send an email with a verification link to '${ sanitizeString ( viewModel . emailAddress ) } '
25- </ p >
26- < form action ="?next=/me " method ="post ">
32+ ${ description }
33+ < form action ="?next=/member/ ${ viewModel . memberNumber } " method ="post ">
2734 < input
2835 type ="hidden "
2936 name ="email "
@@ -66,6 +73,7 @@ const constructForm: Form<ViewModel>['constructForm'] =
6673 user,
6774 memberNumber : params . member ,
6875 emailAddress : params . email ,
76+ isSelf : user . memberNumber === params . member
6977 } ) )
7078 ) ;
7179
You can’t perform that action at this time.
0 commit comments