add clear button

This commit is contained in:
Pritimay Sarkar
2023-09-25 00:20:42 +05:30
parent 924e48c1f0
commit 3774972839

View File

@@ -56,6 +56,24 @@ function Registration() {
});
}
const clearsUsers = () => {
setMessage("");
axios({
method: 'get',
url: "https://asia-south1-hpos-preprod.cloudfunctions.net/clearUsers",
withCredentials: false,
secure: false,
headers: {
"Content-Type": "application/json",
"x-client": "e16a1bd15af2ee640f5a7a18c8d8333f5f01f7c66e003bbc21ee52870f1bce27",
},
})
.then(response => response.data)
.then((data) => {
setMessage(`${JSON.stringify(data)}`);
});
}
const onNameChange = (event) => {
setName(event.target.value);
}
@@ -69,6 +87,9 @@ function Registration() {
<div className='dates'>
<div className='button' onClick={() => createUser()}>Create User</div>
</div>
<div className='dates'>
<div className='button' onClick={() => clearsUsers()}>Clear Users</div>
</div>
<div>{message && <div className='message'>{message}</div>}</div>
</div>
);