File tree 4 files changed +30
-0
lines changed
4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ Router.map(function() {
45
45
this . route ( 'catchAll' , { path : '*path' } ) ;
46
46
this . route ( 'team' , { path : '/teams/:team_id' } ) ;
47
47
this . route ( 'policies' ) ;
48
+ this . route ( 'confirm' , { path : '/confirm/:email_token' } ) ;
48
49
} ) ;
49
50
50
51
export default Router ;
Original file line number Diff line number Diff line change
1
+ import Ember from 'ember' ;
2
+ import { inject as service } from '@ember/service' ;
3
+
4
+ export default Ember . Route . extend ( {
5
+ flashMessages : service ( ) ,
6
+ ajax : service ( ) ,
7
+
8
+ model ( params ) {
9
+ console . log ( params ) ;
10
+
11
+ return this . get ( 'ajax' ) . raw ( `/api/v1/confirm/${ params . email_token } ` , { method : 'PUT' , data : { } } )
12
+ . then ( ( { response} ) => {
13
+ console . log ( "response: " + response )
14
+ } )
15
+ . catch ( ( error ) => {
16
+ console . log ( error . payload ) ;
17
+ if ( error . payload ) {
18
+ console . log ( "finding error in payload: " + error . payload . errors [ 0 ] . detail ) ;
19
+ this . get ( 'flashMessages' ) . queue ( `Error in email confirmation: ${ error . payload . errors [ 0 ] . detail } ` ) ;
20
+ return ;
21
+ } else {
22
+ this . get ( 'flashMessages' ) . queue ( `Unknown error in email confirmation` ) ;
23
+ return ;
24
+ }
25
+ } ) ;
26
+ }
27
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <h1 >Something went wrong in confirm</h1 >
Original file line number Diff line number Diff line change
1
+ <h1 >Thanks for confimring</h1 >
You can’t perform that action at this time.
0 commit comments