Format
This commit is contained in:
@@ -25,30 +25,30 @@
|
||||
<div class="btn btn-primary" id="get"> Get</div>
|
||||
<br>
|
||||
<div id="text"></div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
async function deleteUser(){
|
||||
async function deleteUser() {
|
||||
const password = document.getElementById('password').value;
|
||||
const response = await fetch('/user', {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({"password": password}),
|
||||
body: JSON.stringify({ "password": password }),
|
||||
})
|
||||
const data = await response.json();
|
||||
document.getElementById('text').innerHTML = data.message;
|
||||
document.getElementById('text').innerHTML = data.message;
|
||||
}
|
||||
|
||||
async function getUser(){
|
||||
async function getUser() {
|
||||
const password = document.getElementById('password').value;
|
||||
const response = await fetch('/user', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({"password": password}),
|
||||
body: JSON.stringify({ "password": password }),
|
||||
})
|
||||
const data = await response.json();
|
||||
console.log(data);
|
||||
|
Reference in New Issue
Block a user