added profile stuffi

This commit is contained in:
2019-08-14 16:37:28 +02:00
parent fb65086adb
commit ab4693acd7
5 changed files with 81 additions and 9 deletions

View File

@@ -61,3 +61,5 @@ export function fetchProfile(jwt: any) {
Vue.$log.debug('JWT: ' + jwt);
return axios.get(`${API_URL}/v1/user/profile`, { headers: { Authorization: `Bearer ${jwt}` } });
}

View File

@@ -2,6 +2,9 @@
// @ts-ignore
import Repository from './Repository';
import Vue from 'vue/types/vue';
import axios from 'axios';
import {dictEmptyValToNull} from '@/utils';
const resource = '/user';
@@ -17,4 +20,8 @@ export default {
createUser(userData: any) {
return Repository.post(`${resource}`, userData);
},
updateProfile(userData: any) {
return Repository.put(`${resource}/profile`, dictEmptyValToNull(userData));
},
};