Add member resync
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8363105dcc
commit
29f4495265
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Member\Controllers;
|
||||
|
||||
use App\Actions\MemberPullAction;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Member\Member;
|
||||
use App\Setting\NamiSettings;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class MemberResyncController extends Controller
|
||||
{
|
||||
public function __invoke(Member $member, NamiSettings $settings): RedirectResponse
|
||||
{
|
||||
if ($member->hasNami) {
|
||||
app(MemberPullAction::class)->api($settings->login())->member($member->group->nami_id, $member->nami_id)->execute();
|
||||
}
|
||||
|
||||
return redirect()->route('member.edit', ['member' => $member])->success('Mitglied aktualisiert');
|
||||
}
|
||||
}
|
|
@ -267,7 +267,9 @@ export default {
|
|||
? this.$inertia.post(`/member`, this.inner)
|
||||
: this.$inertia.patch(`/member/${this.inner.id}`, this.inner);
|
||||
},
|
||||
resync() {},
|
||||
resync() {
|
||||
this.$inertia.get(`/member/${this.inner.id}/resync`);
|
||||
},
|
||||
forceWrite() {},
|
||||
},
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
use App\Course\Controllers\CourseController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Initialize\InitializeController;
|
||||
use App\Member\Controllers\MemberResyncController;
|
||||
use App\Member\MemberConfirmController;
|
||||
use App\Member\MemberController;
|
||||
use App\Membership\MembershipController;
|
||||
|
@ -34,4 +35,5 @@ Route::group(['middleware' => 'auth:web'], function (): void {
|
|||
Route::resource('setting', SettingController::class);
|
||||
Route::resource('member.course', CourseController::class);
|
||||
Route::get('/member/{member}/efz', MemberEfzController::class)->name('efz');
|
||||
Route::get('/member/{member}/resync', MemberResyncController::class)->name('member.resync');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue