27 lines
528 B
TypeScript
27 lines
528 B
TypeScript
'use server'
|
|||
|
|
|
||
|
|
export async function testConnect() {
|
||
|
|
try {
|
||
|
|
const response = await fetch('http://localhost:8080/api/auth/register', {
|
||
|
|
method: 'POST',
|
||
|
|
body: JSON.stringify({
|
||
|
|
"firstName": "Serg",
|
||
|
|
"secondName": "Fedorovich",
|
||
|
|
"lastName": "Tankan",
|
||
|
|
"email": "gggpetst2test@e.ru",
|
||
|
|
"password": "1121231412"
|
||
|
|
}),
|
||
|
|
headers: {
|
||
|
|
"Content-Type": "application/json",
|
||
|
|
"Accept": "application/json"
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
let parsed = await response.json();
|
||
|
|
|
||
|
|
return parsed;
|
||
|
|
} catch (error) {
|
||
|
|
throw error;
|
||
|
|
}
|
||
|
|
}
|