Fixed: Create payment
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2021-11-11 22:38:03 +01:00
parent 42ac6ee7a1
commit 5a83b5a8b4
2 changed files with 10 additions and 3 deletions

View File

@ -27,7 +27,7 @@ class PaymentController extends Controller
'status_id' => 'required|exists:statuses,id', 'status_id' => 'required|exists:statuses,id',
])); ]));
return redirect()->route('member.payment.index', ['member' => $member]); return redirect()->back();
} }
public function edit(Member $member, Request $request, Payment $payment) { public function edit(Member $member, Request $request, Payment $payment) {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="sidebar flex flex-col"> <div class="sidebar flex flex-col">
<sidebar-header :links="value.links" @close="$emit('close')" title="Zahlungen"></sidebar-header> <sidebar-header :links="indexLinks" @close="$emit('close')" @create="mode = 'create'; single = {}" title="Zahlungen"></sidebar-header>
<form v-if="single" class="p-6 grid gap-4 justify-start" @submit.prevent="submit"> <form v-if="single" class="p-6 grid gap-4 justify-start" @submit.prevent="submit">
<f-text id="nr" v-model="single.nr" label="Jahr" required></f-text> <f-text id="nr" v-model="single.nr" label="Jahr" required></f-text>
@ -42,6 +42,9 @@ export default {
return { return {
mode: null, mode: null,
single: null, single: null,
indexLinks: [
{event: 'create', label: 'Neue Zahlung'}
]
}; };
}, },
@ -68,7 +71,11 @@ export default {
var _self = this; var _self = this;
this.mode === 'create' this.mode === 'create'
? this.$inertia.post(`/member/${this.value.data.id}/payment`, this.inner) ? this.$inertia.post(`/member/${this.value.id}/payment`, this.single, {
onFinish() {
_self.single = null;
}
})
: this.$inertia.patch(`/member/${this.value.id}/payment/${this.single.id}`, this.single, { : this.$inertia.patch(`/member/${this.value.id}/payment/${this.single.id}`, this.single, {
onFinish() { onFinish() {
_self.single = null; _self.single = null;