This commit is contained in:
Martin Folkerts 2024-07-09 09:55:52 +02:00
parent 07d5e81a27
commit d8c730e0f9
5 changed files with 8 additions and 9 deletions

View file

@ -141,7 +141,6 @@ public function deleteEmailRecipient($index)
*/ */
public function confirmReportDeletion($reportId) public function confirmReportDeletion($reportId)
{ {
$this->confirmingReportDeletion = true; $this->confirmingReportDeletion = true;
$this->reportIdBeingDeleted = $reportId; $this->reportIdBeingDeleted = $reportId;
} }
@ -207,7 +206,6 @@ private function validateForm()
], ],
'pivot_file.extension' => ['sometimes', function ($attribute, $value, $fail) { 'pivot_file.extension' => ['sometimes', function ($attribute, $value, $fail) {
if ($value && $value != 'json') { if ($value && $value != 'json') {
$fail('Not a json file'); $fail('Not a json file');
} }
}], }],

View file

@ -63,12 +63,13 @@ public static function saveWithFormData(mixed $formData)
$project->setMinHarvestDate(); $project->setMinHarvestDate();
} }
} }
self::upsertMailRecipients($formData, $project);
} }
private function upsertMailRecipients($formData) private static function upsertMailRecipients($formData, Project $project)
{ {
$mailRecipientsData = array_map(function ($mailRecipient) { $mailRecipientsData = array_map(function ($mailRecipient) use ($project) {
$mailRecipient['project_id'] = $this->id; $mailRecipient['project_id'] = $project->id;
unset($mailRecipient['created_at']); unset($mailRecipient['created_at']);
unset($mailRecipient['updated_at']); unset($mailRecipient['updated_at']);
$mailRecipient['id'] ??= null; $mailRecipient['id'] ??= null;

View file

@ -44,7 +44,7 @@
"src": "node_modules/leaflet/dist/images/marker-icon.png" "src": "node_modules/leaflet/dist/images/marker-icon.png"
}, },
"resources/css/app.css": { "resources/css/app.css": {
"file": "assets/app-e4d1ce6a.css", "file": "assets/app-d3f21131.css",
"isEntry": true, "isEntry": true,
"src": "resources/css/app.css" "src": "resources/css/app.css"
}, },

View file

@ -88,10 +88,10 @@
<div class="md:w-2/3"> <div class="md:w-2/3">
<form x-init=" <form x-init="
$nextTick(() => { $nextTick(() => {
@if($formData['pivot_file']) @if($formData['pivot_file'] && is_string($formData['pivot_file']))
showMap({{$formData['pivot_file']}},'pivot_file'); showMap({{$formData['pivot_file']}},'pivot_file');
@endif @endif
@if($formData['span_file']) @if($formData['span_file'] && is_string($formData['span_file']))
showMap({{$formData['span_file']}},'span_file'); showMap({{$formData['span_file']}},'span_file');
@endif @endif
}) })