@@ -69,29 +69,23 @@ export class mail {
69
69
}
70
70
71
71
_isDeliverable ( email ) {
72
- const requestOptions = {
73
- method : "GET" ,
74
- redirect : "follow" ,
75
- } ;
72
+ // const requestOptions = {
73
+ // method: "GET",
74
+ // redirect: "follow",
75
+ // };
76
76
77
77
return fetch (
78
- `http://api.eva.pingutil.com/email?email=${ email } ` ,
79
- requestOptions
78
+ // * fixed. change in validation checking api
79
+ `https://open.kickbox.com/v1/disposable/${ email } `
80
+ // `http://api.eva.pingutil.com/email?email=${email}`,
81
+ // requestOptions
80
82
)
81
83
. then ( ( response ) => response . json ( ) )
82
84
. then ( ( res ) => {
83
- if ( res . status === "success" ) {
84
- if ( res . data . deliverable ) {
85
- this . _sendMail ( ) ;
86
- } else {
87
- //!raise error-solved
88
- if ( this . error . classList . contains ( "success" ) ) {
89
- revertSuccess . call ( this , "Invalid email address !!!" ) ;
90
- }
91
- this . errorText . textContent = "Invalid email address !!!" ;
92
- this . error . style . opacity = 1 ;
93
- throw new Error ( "email address not delievarable" ) ;
94
- }
85
+ console . log ( res ) ;
86
+ console . log ( res ) ;
87
+ if ( ! res . disposable ) {
88
+ this . _sendMail ( ) ;
95
89
} else {
96
90
//!raise error-solved
97
91
if ( this . error . classList . contains ( "success" ) ) {
@@ -104,6 +98,7 @@ export class mail {
104
98
} )
105
99
. catch ( ( err ) => {
106
100
//!raise error-solved
101
+ console . log ( "errror from line 107" ) ;
107
102
if ( this . error . classList . contains ( "success" ) ) {
108
103
revertSuccess . call ( this , ` Error: ${ err . message } !!!` ) ;
109
104
}
@@ -139,7 +134,10 @@ export class mail {
139
134
this . error . style . opacity = 1 ;
140
135
}
141
136
} )
142
- . catch ( ( err ) => console . error ( err ) ) ;
137
+ . catch ( ( err ) => {
138
+ console . log ( "the error is from line 143" ) ;
139
+ console . error ( err ) ;
140
+ } ) ;
143
141
}
144
142
}
145
143
0 commit comments