Create user
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
|
||||
export function showUsers(api) {
|
||||
const tbody = document.getElementById("user-table").getElementsByTagName("tbody")[0];
|
||||
const token = localStorage.getItem("token");
|
||||
@ -34,3 +33,24 @@ export function showUsers(api) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function showUser(api) {
|
||||
const token = localStorage.getItem("token");
|
||||
let id = window.location.pathname.split("/").pop();
|
||||
|
||||
const requestOptions = {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Accept': `application/json`,
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
};
|
||||
|
||||
fetch(api + `/api/admin/all-users/${id}`, requestOptions)
|
||||
.then(response => response.json())
|
||||
.then(function (data) {
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
}
|
Reference in New Issue
Block a user