wip
This commit is contained in:
parent
0a37fd2d91
commit
025f306d49
|
|
@ -214,7 +214,7 @@ private function validateForm()
|
|||
'name' => $this->formData['name'],
|
||||
'pivot_file' => $this->pivotFiles[0] ?? null,
|
||||
'span_file' => $this->spanFiles[0] ?? null,
|
||||
'harvest_data_file' => $this->harvestDataFiles[0] ?? null,
|
||||
'harvest_file' => $this->harvestDataFiles[0] ?? null,
|
||||
'boundingBoxes' => $this->formData['boundingBoxes'],
|
||||
], [
|
||||
'name' => [
|
||||
|
|
@ -223,9 +223,17 @@ private function validateForm()
|
|||
'string',
|
||||
'max:255'
|
||||
],
|
||||
'pivot_file' => ['sometimes'],
|
||||
'span_file' => ['sometimes'],
|
||||
'harvestDataFile' => ['sometimes',new HarvestFile],
|
||||
'pivot_file.extension' => ['sometimes',function ($attribute, $value, $fail) {
|
||||
if($value != 'json'){
|
||||
$fail('Not a json file');
|
||||
}
|
||||
}],
|
||||
'span_file' => ['sometimes',function ($attribute, $value, $fail) {
|
||||
if($value != 'json'){
|
||||
$fail('Not a json file');
|
||||
}
|
||||
}],
|
||||
'harvest_file' => ['sometimes',new HarvestFile],
|
||||
'boundingBoxes' => ['required', 'array', 'min:1'],
|
||||
'boundingBoxes.*.name' => ['required', 'string', 'max:255'],
|
||||
'boundingBoxes.*.top_left_latitude' => ['required', 'string'],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class HarvestFile implements ValidationRule
|
|||
*/
|
||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
{
|
||||
//
|
||||
$extensions = [''];
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@
|
|||
<livewire:dropzone
|
||||
wire:model="harvestDataFiles"
|
||||
:rules="['extensions:xls,xlsx,ods','mimes:xls,xlsx,ods','required']"
|
||||
:key="'harvestDataFiles'"
|
||||
:key="'harvest_file'"
|
||||
/>
|
||||
@error('harvestDataFiles')
|
||||
@error('harvest_file')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue