1
1
import { cookies } from "next/headers" ;
2
- import { LoginResponse , Question , StatusBody , UserServiceResponse } from "./structs" ;
2
+ import {
3
+ LoginResponse ,
4
+ Question ,
5
+ StatusBody ,
6
+ UserServiceResponse ,
7
+ } from "./structs" ;
3
8
import DOMPurify from "isomorphic-dompurify" ;
4
9
import { CookieNames } from "@/app/actions/session" ;
5
10
import { revalidatePath } from "next/cache" ;
@@ -26,7 +31,7 @@ export function generateJSONHeaders() {
26
31
}
27
32
28
33
export async function fetchQuestion (
29
- questionId : numbe ,
34
+ questionId : number ,
30
35
) : Promise < Question | StatusBody > {
31
36
try {
32
37
const response = await fetch (
@@ -40,7 +45,7 @@ export async function fetchQuestion(
40
45
if ( ! response . ok ) {
41
46
return {
42
47
error : await response . text ( ) ,
43
- status : response . statu ,
48
+ status : response . status ,
44
49
} ;
45
50
}
46
51
@@ -94,7 +99,7 @@ export async function postSignupUser(validatedFields: {
94
99
method : "POST" ,
95
100
body : JSON . stringify ( validatedFields ) ,
96
101
headers : {
97
- "Content-type" : "application/json; charset=UTF-8,
102
+ "Content-type" : "application/json; charset=UTF-8" ,
98
103
} ,
99
104
} ,
100
105
) ;
@@ -117,7 +122,7 @@ export async function verifyUser(): Promise<UserServiceResponse | StatusBody> {
117
122
`${ process . env . NEXT_PUBLIC_NGINX } /${ process . env . NEXT_PUBLIC_USER_SERVICE } /auth/verify-token` ,
118
123
{
119
124
method : "GET" ,
120
- headers : generateAuthHeaders ( )
125
+ headers : generateAuthHeaders ( ) ,
121
126
} ,
122
127
) ;
123
128
const json = await res . json ( ) ;
0 commit comments