added admin (group, user) interface components

This commit is contained in:
Tobias Kurze
2019-04-10 09:20:13 +02:00
parent a15e0c2d50
commit c043918fb8
13 changed files with 282 additions and 13 deletions

12
src/api/Repository.js Normal file
View File

@@ -0,0 +1,12 @@
// Repository.js
import Vue from 'vue';
import axios from "axios";
const baseDomain = "http://localhost:5443";
const API_URL = `${baseDomain}/api/v1`;
export default axios.create({
API_URL,
headers: { headers: { Authorization: `Bearer ${jwt}` } },
});

View File

@@ -45,6 +45,10 @@ export function fetchUsers(jwt: any) {
return axios.get(`${API_URL}/v1/user`, { headers: { Authorization: `Bearer ${jwt}` } });
}
export function createUser(jwt: any, userData: any) {
return axios.post(`${API_URL}/v1/user`, userData, { headers: { Authorization: `Bearer ${jwt}` } });
}
export function fetchProfile(jwt: any) {
Vue.$log.debug("JWT: "+ jwt);
return axios.get(`${API_URL}/v1/user/profile`, { headers: { Authorization: `Bearer ${jwt}` } });