Added default user option and user control

This commit is contained in:
frikky
2020-06-22 13:17:14 +02:00
parent 1bc8648f1c
commit 7c940e57d4
5 changed files with 251 additions and 238 deletions
+7 -4
View File
@@ -319,14 +319,17 @@ const Admin = (props) => {
modalUser[field] = value
}
const generateApikey = () => {
const generateApikey = (userId) => {
const data = {"user_id": userId}
fetch(globalUrl+"/api/v1/generateapikey", {
method: 'GET',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
credentials: "include",
body: JSON.stringify(data),
credentials: "include",
})
.then((response) => {
if (response.status !== 200) {
@@ -407,7 +410,7 @@ const Admin = (props) => {
style={{}}
variant="outlined"
color="primary"
onClick={() => generateApikey(selectedUser)}
onClick={() => generateApikey(selectedUser.id)}
>
Get new API key
</Button>