Skip to content

Commit

Permalink
Bug no. 39 - Readonly pole se ukládá, lze změnit termín přidáním term_id
Browse files Browse the repository at this point in the history
Při úpravě přihlášky rodičem lze v HTML odebrat readonly
atribut a ukládat tak hodnotu.
Navíc přidáním pole term_id lze změnit i termín přihlášky. Příklad ve Wiki
  • Loading branch information
arxeiss committed Mar 4, 2024
1 parent ff40f2c commit 63ab676
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/Http/Requests/Student/UpdateStudentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public function rules(?Term $term = null): array
$term = $this->route()->student->term;
$rules = parent::rules($term);

unset($rules['forename']);
unset($rules['surname']);
// unset($rules['forename']);
// unset($rules['surname']);
unset($rules['terms_conditions']);

return $rules;
Expand All @@ -31,9 +31,12 @@ public function getData(bool $addTerm = false): array
{
$data = parent::getData($addTerm);

unset($data['term_id']);
unset($data['forename']);
unset($data['surname']);
if ($data['term_id'] === null) {
unset($data['term_id']);
}

// unset($data['forename']);
// unset($data['surname']);

return $data;
}
Expand Down

0 comments on commit 63ab676

Please sign in to comment.