added admin (group, user) interface components
This commit is contained in:
12
src/api/Repository.js
Normal file
12
src/api/Repository.js
Normal 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}` } },
|
||||
});
|
||||
@@ -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}` } });
|
||||
|
||||
Reference in New Issue
Block a user