show table with transaction links from user

This commit is contained in:
ogerly 2022-03-22 11:10:44 +01:00
parent 942d4d2d3a
commit af7105191e
5 changed files with 22 additions and 35 deletions

View File

@ -1,12 +1,11 @@
<template>
<div class="links-transaction-list-formular">
Transaction Links
{{items}}
{{ $t('transactionlink.form_header') }}
<b-table striped hover :fields="fields" :items="items"></b-table>
</div>
</template>
<script>
import { getListTransactionLinks } from '../graphql/getListTransactionLinks'
import { listTransactionLinks } from '../graphql/listTransactionLinks.js'
export default {
name: 'LinksTransactionListFormular',
props: {
@ -16,8 +15,8 @@ export default {
return {
fields: [
{
key: 'creationDate',
label: this.$t('transactionlist.date'),
key: 'createdAt',
label: this.$t('transactionlink.created'),
formatter: (value, key, item) => {
return this.$d(new Date(value))
},
@ -29,17 +28,10 @@ export default {
return `${value} GDD`
},
},
{
key: 'linkedUser',
label: this.$t('transactionlist.community'),
formatter: (value, key, item) => {
return `${value.firstName} ${value.lastName}`
},
},
{ key: 'memo', label: this.$t('transactionlist.memo') },
{
key: 'balanceDate',
label: this.$t('transactionlist.balanceDate'),
key: 'validUntil',
label: this.$t('transactionlink.expired'),
formatter: (value, key, item) => {
return this.$d(new Date(value))
},
@ -50,18 +42,19 @@ export default {
},
methods: {
getListTransactionLinks() {
alert('es wird nur die id von peter erkannt. bitte die links der userId aus dem backend geben.')
this.$apollo
.query({
query: getListTransactionLinks,
query: listTransactionLinks,
variables: {
currentPage: 1,
pageSize: 25,
order: 'DESC',
pageSize: 5,
userId: parseInt(this.userId),
},
})
.then((result) => {
this.items = result.data.getListTransactionLinks
console.log(result.data.listTransactionLinks)
this.items = result.data.listTransactionLinks
})
.catch((error) => {
this.toastError(error.message)

View File

@ -73,7 +73,7 @@
v-if="!row.item.deletedAt"
:userId="row.item.userId"
/>
<links-transaction-list-formular :userId="row.item.userId"/>
<links-transaction-list-formular :userId="row.item.userId" />
<deleted-user-formular :item="row.item" @updateDeletedAt="updateDeletedAt" />
</b-card>

View File

@ -1,16 +0,0 @@
import gql from 'graphql-tag'
export const listTransactionLinks = gql`
query($currentPage: Int = 1, $pageSize: Int = 25) {
listTransactionLinks(currentPage: $currentPage, pageSize: $pageSize) {
id
amount
holdAvailableAmount
memo
code
createdAt
validUntil
redeemedAt
}
}
`

View File

@ -81,6 +81,11 @@
"memo": "Nachricht",
"title": "Alle geschöpften Transaktionen für den Nutzer"
},
"transactionlink": {
"form_header": "Transaktion Links",
"created":"Erstellt",
"expired":"Abgelaufen"
},
"undelete_user": "Nutzer wiederherstellen",
"unregistered_emails": "Nur unregistrierte Nutzer",
"unregister_mail": {

View File

@ -81,6 +81,11 @@
"memo": "Message",
"title": "All creation-transactions for the user"
},
"transactionlink": {
"form_header": "Transaction links",
"created":"Created",
"expired":"Expired"
},
"undelete_user": "Undelete User",
"unregistered_emails": "Only unregistered users",
"unregister_mail": {