From 4b73c7913925d2591ae16c2c20830c0f23e8a1a7 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 28 Aug 2024 22:28:12 +0200 Subject: [PATCH] Fix member links --- app/Member/MemberResource.php | 3 +-- tests/Feature/Member/ShowTest.php | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Member/MemberResource.php b/app/Member/MemberResource.php index 4d68d368..e2f53d33 100644 --- a/app/Member/MemberResource.php +++ b/app/Member/MemberResource.php @@ -111,7 +111,7 @@ class MemberResource extends JsonResource 'invoiceposition_index' => route('member.invoice-position.index', ['member' => $this->getModel()]), 'course_index' => route('member.course.index', ['member' => $this->getModel()]), 'show' => route('member.show', ['member' => $this->getModel()]), - 'edit' => route('member.edit', ['member' => $this->getModel()]), + 'update' => route('member.update', ['member' => $this->getModel()]), ], ]; } @@ -155,7 +155,6 @@ class MemberResource extends JsonResource 'members' => Member::ordered()->get()->map(fn ($member) => ['id' => $member->id, 'name' => $member->fullname]), 'links' => [ 'index' => route('member.index'), - 'create' => route('member.create'), ], 'default_membership_filter' => [ 'group_ids' => [], diff --git a/tests/Feature/Member/ShowTest.php b/tests/Feature/Member/ShowTest.php index 4c0e431f..652f7500 100644 --- a/tests/Feature/Member/ShowTest.php +++ b/tests/Feature/Member/ShowTest.php @@ -128,7 +128,8 @@ class ShowTest extends TestCase ->assertJsonPath('data.courses.0.course.short_name', '2e') ->assertJsonPath('data.invoicePositions.0.description', 'uu') ->assertJsonPath('data.invoicePositions.0.price_human', '10,50 €') - ->assertJsonPath('data.invoicePositions.0.invoice.status', 'Neu'); + ->assertJsonPath('data.invoicePositions.0.invoice.status', 'Neu') + ->assertJsonPath('data.links.update', route('member.update', ['member' => $member])); } public function testItShowsMinimalSingleMember(): void