33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
import Vue from 'vue'
|
|
|
|
export const logWithGoogle = (oauthToken) => {
|
|
const headers = {
|
|
"Authorization": "Bearer "+oauthToken
|
|
};
|
|
return Vue.axios.get("http://localhost:8081/users",{headers}).then(response => {return response.data})
|
|
}
|
|
|
|
export const getAccounts = (oauthToken, userId) => {
|
|
const headers = {
|
|
"Authorization": "Bearer "+oauthToken
|
|
};
|
|
return Vue.axios.get("http://localhost:8081/users/"+userId+"/accounts", {headers}).then(response => {console.log(response);return response.data})
|
|
}
|
|
|
|
export const getSharedAccounts = (oauthToken, userId) => {
|
|
const headers = {
|
|
"Authorization": "Bearer "+oauthToken
|
|
};
|
|
return Vue.axios.get("http://localhost:8081/users/"+userId+"/sharedaccounts", {headers}).then(response => {console.log(response);return response.data})
|
|
}
|
|
|
|
export const createAccount = (oauthToken, userId, account) => {
|
|
const headers = {
|
|
"Authorization": "Bearer " + oauthToken
|
|
};
|
|
return Vue.axios.post("http://localhost:8081/configuration", account, {headers}).then(response => {
|
|
console.log(response);
|
|
return response.data
|
|
})
|
|
}
|