fixed error handling, change reviews fixed

This commit is contained in:
ogerly 2021-08-11 08:24:52 +02:00
parent ae1aaa9741
commit 01b58d5f6b
5 changed files with 8 additions and 85 deletions

View File

@ -1,45 +0,0 @@
{"state":"success", "gdt":
[
{
"id": 8821,
"amount": 1000,
"date": "2020-08-12T14:12:00+00:00",
"email": "foerderkreis-1@gradido.org",
"comment": null,
"coupon_code": "",
"gdt_entry_type_id": 4,
"factor": "20.0000",
"amount2": 0,
"factor2": "0.0500",
"gdt": 1000
},
{
"id": 8552,
"amount": 1000,
"date": "2020-06-17T14:12:00+00:00",
"email": "foerderkreis-1@gradido.org",
"comment": null,
"coupon_code": "",
"gdt_entry_type_id": 4,
"factor": "20.0000",
"amount2": 0,
"factor2": "0.0500",
"gdt": 1000
},
{
"id": 8317,
"amount": 1000,
"date": "2020-03-16T14:12:00+00:00",
"email": "foerderkreis-1@gradido.org",
"comment": null,
"coupon_code": "",
"gdt_entry_type_id": 4,
"factor": "20.0000",
"amount2": 0,
"factor2": "0.0500",
"gdt": 1000
}
],
"transactionExecutingCount": 3000,
"count": 3
}

View File

@ -170,7 +170,7 @@
},
"gdt": {
"gdt-received":"Gradido Transform (GDT) erhalten",
"factor":"Factor",
"factor":"Faktor",
"conversion-gdt-euro":"Umrechnung Euro / Gradido Transform (GDT)",
"calculation":"Berechnung der Gradido Transform",
"conversion":"Umrechnung",

View File

@ -136,7 +136,7 @@ export default {
this.pending = false
} else {
this.pending = true
// what to do when loading balance fails?
this.$toasted.error(result.result.message)
}
},
updateBalance(ammount) {

View File

@ -125,9 +125,3 @@ export default {
},
}
</script>
<style>
.active {
background-color: rgba(192, 192, 192, 0.568);
}
</style>

View File

@ -17,13 +17,6 @@
} in this.transactionsGdt"
:key="id"
>
<div class="d-flex w-100 justify-content-between pb-3">
<h5 class="mb-1">
{{ $t('gdt.gdt-received') }} {{ comment ? ': [' + comment + ']' : '' }}
</h5>
<small>{{ $d($moment(date), 'long') }} {{ $i18n.locale === 'de' ? 'Uhr' : '' }}</small>
</div>
<!-- ROW Start -->
<div class="d-flex gdt-transaction-list-item" v-b-toggle="'a' + date + ''">
<!-- ICON -->
@ -124,16 +117,6 @@
<script>
import communityAPI from '../../../apis/communityAPI'
const iconsByType = {
1: { icon: 'arrow-left-circle', classes: 'text-success', operator: '+' },
2: { icon: 'arrow-left-circle', classes: 'text-success', operator: '+' },
3: { icon: 'arrow-left-circle', classes: 'text-success', operator: '+' },
4: { icon: 'arrow-left-circle', classes: 'text-success', operator: '+' },
5: { icon: 'arrow-left-circle', classes: 'text-success', operator: '+' },
6: { icon: 'arrow-left-circle', classes: 'text-success', operator: '+' },
7: { icon: 'arrow-left-circle', classes: 'text-info', operator: '+' },
}
export default {
name: 'gdt-transaction-list',
data() {
@ -143,23 +126,14 @@ export default {
}
},
methods: {
getProperties(givenType) {
const type = iconsByType[givenType]
if (type)
return {
icon: type.icon,
class: type.classes + ' m-mb-1 font2em',
operator: type.operator,
}
this.throwError('no icon to given type')
},
throwError(msg) {
throw new Error(msg)
},
async updateGdt() {
const result = await communityAPI.transactionsgdt(this.$store.state.sessionId)
this.transactionsGdt = result.result.data.gdtEntries
this.transactionGdtCount = result.result.data.count
if (result.success) {
this.transactionsGdt = result.result.data.gdtEntries
this.transactionGdtCount = result.result.data.count
} else {
this.$toasted.error(result.result.message)
}
},
},
mounted() {