Version 2.0
This commit is contained in:
@@ -66,7 +66,7 @@ class EditFeedback extends EditRecord
|
||||
->disk('public')
|
||||
->directory('feedback-attachments')
|
||||
->acceptedFileTypes(['image/jpeg', 'image/png', 'application/pdf', 'video/mp4', 'video/quicktime'])
|
||||
->maxSize(51200) // 50MB in KB
|
||||
->maxSize(51200)
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->action(function (array $data): void {
|
||||
@@ -166,14 +166,10 @@ class EditFeedback extends EditRecord
|
||||
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
if (($data['is_general'] ?? false) === true) {
|
||||
$data['customer_product_id'] = null;
|
||||
}
|
||||
|
||||
$this->pendingAttachments = $data['attachments'] ?? [];
|
||||
$this->pendingCollection = $data['attachment_collection'] ?? 'general';
|
||||
|
||||
unset($data['is_general'], $data['attachment_collection'], $data['attachments']);
|
||||
unset($data['is_general'], $data['attachment_collection'], $data['attachments'], $data['product_id_virtual']);
|
||||
|
||||
$newStatus = $data['status'] ?? null;
|
||||
if ($newStatus === 'closed' && $this->getRecord()->status !== 'closed') {
|
||||
@@ -235,7 +231,7 @@ class EditFeedback extends EditRecord
|
||||
|
||||
protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
$data['is_general'] = $data['customer_product_id'] === null;
|
||||
$data['is_general'] = $data['contract_id'] === null;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user