correctly use envs to query transactions

Cleanups
This commit is contained in:
Ulf Gebhardt 2021-03-24 04:52:28 +01:00
parent 6c9ec810f3
commit 4ed7a63e24
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
3 changed files with 15 additions and 29 deletions

View File

@ -13,6 +13,8 @@ const server = {
LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/',
COMMUNITY_API_STATE_BALANCE_URL: process.env.COMMUNITY_API_STATE_BALANCE_URL || 'http://localhost/state-balances/',
COMMUNITY_API_TRANSACTION_CREATION_URL: process.env.COMMUNITY_API_TRANSACTION_CREATION_URL || 'http://localhost/transaction-creations/',
// TODO is this the right API call? what does it do?
COMMUNITY_API_TRANSACTION_SEND_COINS: process.env.COMMUNITY_API_TRANSACTION_SEND_COINS || 'http://localhost/transaction-send-coins/',
}
const CONFIG = {

View File

@ -98,9 +98,6 @@ export const store = new Vuex.Store({
//dispatch('logout')
}
//}, (error) => {
//console.log(error);
//});
},
passwordReset: async (data) => {
console.log("<<<<<<<<<<< PASSWORT RESET TODO >>>>>>>>>>>", data.email)
@ -142,7 +139,7 @@ export const store = new Vuex.Store({
//console.log('action: ajaxCreate')
state.ajaxCreateData.amount = (state.ajaxCreateData.amount)*10000
const result = await communityAPI.create($cookies.get("gdd_session_id", email, amount, memo))
// console.log(result)
console.log(result)
},
ajaxListTransactions: async ({commit, dispatch, state}) => {
// console.log('action: ajaxListTransactions', state.session_id)

View File

@ -40,6 +40,7 @@
<script>
import axios from 'axios';
import communityAPI from '../../apis/communityAPI'
export default {
name: 'GddTable',
@ -51,32 +52,18 @@ export default {
count: 0
};
},
created() {
async created() {
axios.get("http://localhost/state-balances/ajaxListTransactions/"+ this.$store.state.session_id).then((result) => {
console.log("result",result)
console.log("transactions.length",result.data.count)
console.log("this.$route.path", this.$route.path);
//console.log("result.state",result.data.state)
//console.log("result.data.state == 'success'",result.data.state == "success")
//console.log("result.count",result.data.count)
//console.log("result.gdtSum",result.data.gdtSum)
//console.log("result.transactions",typeof(result.data.transactions))
//commit('transactions', result.data.transactions)
this.$store.state.user.balance_gdt = result.data.gdtSum
this.items = result.data.transactions
this.count = result.data.count
}, (error) => {
console.log(error);
});
const result = await communityAPI.transactions(this.$store.state.session_id)
if( result.success ){
this.$store.state.user.balance_gdt = result.result.data.gdtSum
this.items = result.result.data.transactions
this.count = result.result.data.count
} else {
console.log('error',result)
}
},
computed: {
filteredItems(a) {