Skip to content
Snippets Groups Projects
Verified Commit b3a840d4 authored by Mark's avatar Mark
Browse files

Add delete function to user-panel

parent a2428541
No related branches found
No related tags found
1 merge request!2Minimal frontend
......@@ -51,8 +51,12 @@ export default {
console.log(index);
},
deleteUser: function(username, index){
console.log(username);
console.log(index);
axios.post(
'/api/admin/graphql', {
query: 'mutation{deleteUser(username: "' + username + '"){ok}}'
}).then((res) => {
this.users.splice(index, 1);
});
},
toggleAddUser: function(evt){
if(evt !== undefined){
......@@ -72,7 +76,6 @@ export default {
}
},
addUser: function(){
newUser
const newUser = axios.post(
'/api/admin/graphql', {
query: 'mutation{createUser(username: "' + this.newUser.username + '", password: "'+ this.newUser.password + '", email: "' + this.newUser.email + '"){user{username, email}}}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment