You are on page 1of 1

const handleRegister = ()=>{

fetch(`${baseUrl.url}/api/register`,{
method: "POST",
headers: {Accept:'application/json', 'Content-Type':
'application/json'},
body: JSON.stringify({
"firstName": firstName,
"lastName": lastName,
"address": address,
"emailAddress": emailAddress,
"password": password
})
}
)
.then(response=> response.json())
.then(responseJson=>{
if(responseJson.status===false){
alert(JSON.stringify(responseJson.message));
}else if(responseJson.status===true){
clearTextState();
setSignupModalVisible(false);
setFinalSetup(false);
alert(JSON.stringify(responseJson.message));

}
})

<AppButton title="Register & Get Started" style={{backgroundColor: colors.blood,


alignSelf: "center"}} onPress={handleRegister}/>

You might also like