diff --git a/backend/src/graphql/model/TransactionList.ts b/backend/src/graphql/model/TransactionList.ts index 0175048d1..f1973b7e7 100644 --- a/backend/src/graphql/model/TransactionList.ts +++ b/backend/src/graphql/model/TransactionList.ts @@ -13,8 +13,8 @@ export class TransactionList { this.decayDate = '' } - @Field(() => Number) - gdtSum: number + @Field(() => Number, { nullable: true }) + gdtSum: number | null @Field(() => Number) count: number diff --git a/backend/src/graphql/resolver/GdtResolver.ts b/backend/src/graphql/resolver/GdtResolver.ts index a727c8784..c515b4e26 100644 --- a/backend/src/graphql/resolver/GdtResolver.ts +++ b/backend/src/graphql/resolver/GdtResolver.ts @@ -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]) diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 8fe1e8484..4e40a35c2 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -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) diff --git a/frontend/src/components/Status.vue b/frontend/src/components/Status.vue index 7900763f7..92d00452d 100644 --- a/frontend/src/components/Status.vue +++ b/frontend/src/components/Status.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index ac2b22fc7..5e2ad7246 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -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" diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index a3fbe2ac7..75c70b258 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -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" diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index 8f2f17a5d..a473469b6 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -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) diff --git a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue index 953a0e5e0..ed38ee952 100644 --- a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue @@ -8,6 +8,9 @@ {{ $t('gdt.funding') }} +
+ {{ $t('gdt.not-reachable') }} +
- +

{{ $t('transaction.gdd-text') }}

- +

{{ $t('transaction.gdt-text') }}