progres day 1
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
'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();
|
||||
|
||||
console.log('all fine??');
|
||||
console.log(parsed);
|
||||
|
||||
return parsed;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user