mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into use-bv-toast
This commit is contained in:
commit
6e1ec70926
@ -13,8 +13,8 @@ export class TransactionList {
|
||||
this.decayDate = ''
|
||||
}
|
||||
|
||||
@Field(() => Number)
|
||||
gdtSum: number
|
||||
@Field(() => Number, { nullable: true })
|
||||
gdtSum: number | null
|
||||
|
||||
@Field(() => Number)
|
||||
count: number
|
||||
|
||||
@ -25,13 +25,17 @@ export class GdtResolver {
|
||||
const userRepository = getCustomRepository(UserRepository)
|
||||
const userEntity = await userRepository.findByPubkeyHex(context.pubKey)
|
||||
|
||||
const resultGDT = await apiGet(
|
||||
`${CONFIG.GDT_API_URL}/GdtEntries/listPerEmailApi/${userEntity.email}/${currentPage}/${pageSize}/${order}`,
|
||||
)
|
||||
if (!resultGDT.success) {
|
||||
throw new Error(resultGDT.data)
|
||||
try {
|
||||
const resultGDT = await apiGet(
|
||||
`${CONFIG.GDT_API_URL}/GdtEntries/listPerEmailApi/${userEntity.email}/${currentPage}/${pageSize}/${order}`,
|
||||
)
|
||||
if (!resultGDT.success) {
|
||||
throw new Error(resultGDT.data)
|
||||
}
|
||||
return new GdtEntryList(resultGDT.data)
|
||||
} catch (err: any) {
|
||||
throw new Error('GDT Server is not reachable.')
|
||||
}
|
||||
return new GdtEntryList(resultGDT.data)
|
||||
}
|
||||
|
||||
@Authorized([RIGHTS.EXIST_PID])
|
||||
|
||||
@ -331,11 +331,13 @@ export class TransactionResolver {
|
||||
)
|
||||
|
||||
// get gdt sum
|
||||
const resultGDTSum = await apiPost(`${CONFIG.GDT_API_URL}/GdtEntries/sumPerEmailApi`, {
|
||||
email: userEntity.email,
|
||||
})
|
||||
if (!resultGDTSum.success) throw new Error(resultGDTSum.data)
|
||||
transactions.gdtSum = Number(resultGDTSum.data.sum) || 0
|
||||
transactions.gdtSum = null
|
||||
try {
|
||||
const resultGDTSum = await apiPost(`${CONFIG.GDT_API_URL}/GdtEntries/sumPerEmailApi`, {
|
||||
email: userEntity.email,
|
||||
})
|
||||
if (resultGDTSum.success) transactions.gdtSum = Number(resultGDTSum.data.sum) || 0
|
||||
} catch (err: any) {}
|
||||
|
||||
// get balance
|
||||
const balanceRepository = getCustomRepository(BalanceRepository)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="gdd-status">
|
||||
<div class="p-0 gdd-status-div">
|
||||
{{ pending ? '—' : $n(balance, 'decimal') }} {{ statusText }}
|
||||
{{ pending || balance === null ? '—' : $n(balance, 'decimal') }} {{ statusText }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -109,6 +109,7 @@
|
||||
"funding": "Zu den Förderbeiträgen",
|
||||
"gdt-received": "GradidoTransform (GDT) erhalten",
|
||||
"no-transactions": "Du hast noch keine GradidoTransform (GDT).",
|
||||
"not-reachable": "Der GDT Server ist nicht erreichbar.",
|
||||
"publisher": "Dein geworbenes Mitglied hat einen Beitrag bezahlt",
|
||||
"raise": "Erhöhung",
|
||||
"recruited-member": "Eingeladenes Mitglied"
|
||||
|
||||
@ -109,6 +109,7 @@
|
||||
"funding": "To the funding contributions",
|
||||
"gdt-received": "GradidoTransform (GDT) received",
|
||||
"no-transactions": "You do not have GradidoTransform (GDT) yet.",
|
||||
"not-reachable": "The GDT Server is not reachable.",
|
||||
"publisher": "A member you referred has paid a contribution",
|
||||
"raise": "Increase",
|
||||
"recruited-member": "Invited member"
|
||||
|
||||
@ -92,7 +92,7 @@ export default {
|
||||
const {
|
||||
data: { transactionList },
|
||||
} = result
|
||||
this.GdtBalance = Number(transactionList.gdtSum)
|
||||
this.GdtBalance = transactionList.gdtSum === null ? null : Number(transactionList.gdtSum)
|
||||
this.transactions = transactionList.transactions
|
||||
this.balance = Number(transactionList.decay)
|
||||
this.bookedBalance = Number(transactionList.balance)
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
{{ $t('gdt.funding') }}
|
||||
</b-button>
|
||||
</div>
|
||||
<div v-else-if="typeof transactionGdtCount === 'object'" class="text-center">
|
||||
{{ $t('gdt.not-reachable') }}
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
v-for="{ id, amount, date, comment, gdtEntryType, factor, gdt } in transactionsGdt"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="pb-4">
|
||||
<b-tabs content-class="" justified>
|
||||
<b-tab :title="'Gradido (' + $n(balance, 'decimal') + ' GDD)'" class="px-4">
|
||||
<b-tab :title="`Gradido (${$n(balance, 'decimal')} GDD)`" class="px-4">
|
||||
<p class="tab-tex">{{ $t('transaction.gdd-text') }}</p>
|
||||
|
||||
<gdd-transaction-list
|
||||
@ -13,7 +13,10 @@
|
||||
/>
|
||||
</b-tab>
|
||||
|
||||
<b-tab :title="'Gradido Transform (' + $n(GdtBalance, 'decimal') + ' GDT)'" class="px-4">
|
||||
<b-tab
|
||||
:title="`Gradido Transform (${GdtBalance === null ? '—' : $n(GdtBalance, 'decimal')} GDT)`"
|
||||
class="px-4"
|
||||
>
|
||||
<p class="">{{ $t('transaction.gdt-text') }}</p>
|
||||
|
||||
<gdt-transaction-list />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user