gradido/admin/src/components/CreationTransactionListFormular.vue
2021-12-22 08:25:40 +01:00

47 lines
1.1 KiB
Vue

<template>
<div class="component-creation-transaction-list">
Alle Geschöpften Transaktionen für den User
<b-table striped hover :items="items"></b-table>
</div>
</template>
<script>
import { transactionList } from '../graphql/transactionList'
export default {
name: 'CreationTransactionList',
props: {
userId: { type: Number, required: true },
},
data() {
return {
items: [],
}
},
methods: {
getTransactions() {
this.$apollo
.query({
query: transactionList,
variables: {
currentPage: 1,
pageSize: 25,
order: 'DESC',
onlyCreations: true,
userId: parseInt(this.userId),
},
})
.then((result) => {
this.items = result.data.transactionList.transactions
})
.catch((error) => {
this.$toasted.global.error('Error while searching the creations', error)
// eslint-disable-next-line no-console
console.log('Something went wrong', error)
})
},
},
created() {
this.getTransactions()
},
}
</script>