File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ import { setCookie, deleteCookie } from '../utils/cookie';
44import { User } from '../UserContext' ;
55import { COMPETITIONS_COOKIE_NAME , COOKIE_NAME } from '../configs' ;
66
7+ interface RegisterResponse {
8+ msg : string ;
9+ id : string ;
10+ }
11+
712export const resetPassword = async ( data : {
813 userID : string ;
914 code : string ;
@@ -78,11 +83,11 @@ export const registerUser = async (data: {
7883 email : data . email ,
7984 isUCSD : data . isUCSD ,
8085 } ;
81- return new Promise ( ( resolve , reject ) => {
86+ return new Promise < RegisterResponse > ( ( resolve , reject ) => {
8287 axios
8388 . post ( process . env . REACT_APP_API + '/v1/users' , body )
8489 . then ( ( res : AxiosResponse ) => {
85- resolve ( res ) ;
90+ resolve ( res . data ) ;
8691 } )
8792 . catch ( ( error ) => {
8893 message . error ( error . response . data . error . message ) ;
Original file line number Diff line number Diff line change @@ -21,10 +21,11 @@ function RegisterPage() {
2121 handlePasswordErrors ( errors ) ;
2222 }
2323 registerUser ( { ...values , isUCSD : checked , admin : isAdmin } ) . then ( ( res ) => {
24+ message . success ( 'Please check your email to verify your account' ) ;
2425 message . success ( isAdmin ?
2526 'Admin registered! Redirecting to login page' :
2627 'Registered! Redirecting to login page' ) ;
27- history . push ( '/login' ) ;
28+ history . push ( '/verify/?id=' + res . id ) ;
2829 } ) ;
2930 } ;
3031 const onCheckChange = ( e : any ) => {
You can’t perform that action at this time.
0 commit comments