Add id to participant index

This commit is contained in:
philipp lang 2024-06-21 00:24:27 +02:00
parent 323f136e40
commit cce9d4fa3e
2 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ class ParticipantResource extends JsonResource
{
return [
...$this->getModel()->getFields()->present(),
'id' => $this->id,
'created_at' => $this->created_at->format('Y-m-d H:i:s'),
'created_at_display' => $this->created_at->format('d.m.Y'),
'children_count' => $this->children_count,

View File

@ -35,6 +35,7 @@ class ParticipantIndexActionTest extends FormTestCase
$this->callFilter('form.participant.index', [], ['form' => $form])
->assertOk()
->assertJsonPath('data.0.id', $form->participants->first()->id)
->assertJsonPath('data.0.vorname', 'Max')
->assertJsonPath('data.0.vorname_display', 'Max')
->assertJsonPath('data.0.stufe', 'Pfadfinder')