Skip to content

Commit

Permalink
Validate the countries again
Browse files Browse the repository at this point in the history
  • Loading branch information
alainvd committed Apr 22, 2024
1 parent e10519e commit edc2053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Services/GroupedSubmissionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function sanitizePayload(
$statement['decision_visibility'] ?? [], true);
$content_type_other_required = in_array('CONTENT_TYPE_OTHER', $statement['content_type'] ?? [], true);

$statement['territorial_scope'] = $this->european_countries_service->filterSortEuropeanCountries($statement['territorial_scope'] ?? []);


// Create a new validator instance for each statement
$validator = Validator::make($statement,
Expand All @@ -146,6 +146,7 @@ public function sanitizePayload(

try {
$payload['statements'][$index] = $validator->validated();
$payload['statements'][$index]['territorial_scope'] = $this->european_countries_service->filterSortEuropeanCountries($statement['territorial_scope'] ?? []);
} catch (ValidationException) {
}
}
Expand Down

0 comments on commit edc2053

Please sign in to comment.