Skip to content

Commit efe50a7

Browse files
committed
fix: display null participant type in activity view
1 parent c36056a commit efe50a7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

app/Http/Controllers/ActivityController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ protected function renderCreateView(Request $request, Activity $activity, bool $
4848
if ($activity->participants) {
4949
$activity->load('participants.user');
5050
$activity->participants = $activity->participants->map(fn(ProjectParticipant $participant) => [
51-
...$participant->toArray(), 'name' => $participant->user->name, 'student_id' => $participant->user->student_id,
51+
...$participant->toArray(),
52+
'name' => $participant->user->name,
53+
'student_id' => $participant->user->student_id,
54+
'type' => $participant->type ?? '', // make null type empty string instead, to properly display "-" in select
5255
]);
5356
}
5457

@@ -85,7 +88,7 @@ public function update(Request $request, Activity $activity): \Symfony\Component
8588
'organization' => 'required|filled|string|max:255',
8689
'period_start' => 'required|date',
8790
'period_end' => 'required|date',
88-
'duration' => 'required|numeric|max:999|min:1',
91+
'duration' => 'nullable|numeric|max:999|min:1', // make nullable 2026-02
8992
'description' => 'nullable|string|max:4000',
9093
'attachment' => 'nullable|file|mimes:pdf,docx,doc|max:20000', // File size limit: 20 MB
9194
'participants' => 'nullable|array',

0 commit comments

Comments
 (0)