File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import {useEffect} from "react";
3
3
import { RegistrationRest } from "../../rest/RegistrationRest" ;
4
4
import { Box , CircularProgress , Typography } from "@mui/material" ;
5
5
import { useRouter } from "next/navigation" ;
6
+ import { ParticipantRest } from "../../rest/ParticipantRest" ;
6
7
7
8
export default function Page ( ) {
8
9
@@ -11,9 +12,10 @@ export default function Page() {
11
12
useEffect ( ( ) => {
12
13
if ( typeof window !== 'undefined' ) {
13
14
const queryParameters = new URLSearchParams ( window ?. location ?. search )
14
- const type = queryParameters . get ( "token" )
15
- const registrationRest = new RegistrationRest ( )
16
- registrationRest . verifyToken ( type ) . then ( ( ) => router . push ( "/?isVerified=true" ) )
15
+ const token = queryParameters . get ( "t" )
16
+ const participant = queryParameters . get ( "p" )
17
+ const participantRest = new ParticipantRest ( )
18
+ participantRest . verifyToken ( participant , token ) . then ( ( ) => router . push ( "/?isVerified=true" ) )
17
19
}
18
20
19
21
} , [ ] ) ;
@@ -23,4 +25,4 @@ export default function Page() {
23
25
< Typography > Verifying your Token</ Typography >
24
26
</ Box >
25
27
</ Box >
26
- }
28
+ }
Original file line number Diff line number Diff line change @@ -439,7 +439,8 @@ function Registration() {
439
439
email : values . email ,
440
440
fieldData : JSON . stringify ( values ) ,
441
441
signUpForm : {
442
- id : "283db119-046c-4418-939d-ab9bee06c996" ,
442
+ //id: "283db119-046c-4418-939d-ab9bee06c996",
443
+ id : "2f1c60f2-f30b-4432-8129-9131c6e398dd" ,
443
444
} ,
444
445
group : values . group ,
445
446
} )
Original file line number Diff line number Diff line change
1
+ import axios from "axios" ;
2
+
3
+ export class ParticipantRest {
4
+ //baseUrl = "https://pems-api.hackhpi.org/v1";
5
+
6
+ baseUrl = "http://localhost:8080/v1/participant" ;
7
+
8
+ verifyToken ( participantId , token ) {
9
+ return axios . post ( `${ this . baseUrl } /id/${ participantId } /verify/token/${ token } ` ) ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change 1
1
import axios from "axios" ;
2
2
3
3
export class RegistrationRest {
4
- baseUrl = "https://pems-api.hackhpi.org/v1" ;
5
- // baseUrl = "http://localhost:8080/v1";
4
+ // baseUrl = "https://pems-api.hackhpi.org/v1";
5
+ baseUrl = "http://localhost:8080/v1" ;
6
6
7
7
addRegistration ( data ) {
8
8
return axios . post ( this . baseUrl + "/registration" , data )
You can’t perform that action at this time.
0 commit comments