query transaction links as admin

This commit is contained in:
Moriz Wahl 2022-03-22 19:06:22 +01:00
parent ab0f7c8c7e
commit 752228a7ea
5 changed files with 24 additions and 26 deletions

View File

@ -5,7 +5,7 @@
</div>
</template>
<script>
import { listTransactionLinks } from '../graphql/listTransactionLinks.js'
import { listTransactionLinksAdmin } from '../graphql/listTransactionLinksAdmin.js'
export default {
name: 'LinksTransactionListFormular',
props: {
@ -42,19 +42,17 @@ 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: listTransactionLinks,
query: listTransactionLinksAdmin,
variables: {
currentPage: 1,
pageSize: 5,
userId: parseInt(this.userId),
userId: this.userId,
},
})
.then((result) => {
console.log(result.data.listTransactionLinks)
this.items = result.data.listTransactionLinks
this.items = result.data.listTransactionLinksAdmin
})
.catch((error) => {
this.toastError(error.message)

View File

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

View File

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

View File

@ -83,8 +83,8 @@
},
"transactionlink": {
"form_header": "Transaktion Links",
"created":"Erstellt",
"expired":"Abgelaufen"
"created": "Erstellt",
"expired": "Abgelaufen"
},
"undelete_user": "Nutzer wiederherstellen",
"unregistered_emails": "Nur unregistrierte Nutzer",

View File

@ -83,8 +83,8 @@
},
"transactionlink": {
"form_header": "Transaction links",
"created":"Created",
"expired":"Expired"
"created": "Created",
"expired": "Expired"
},
"undelete_user": "Undelete User",
"unregistered_emails": "Only unregistered users",