Merge changes from main
This commit is contained in:
@@ -60,7 +60,7 @@ class AnswerFormRequest extends FormRequest
|
||||
if(isset($data[$field['id']]) && is_array($data[$field['id']])){
|
||||
$data[$field['id']] = array_map(function ($val) use ($field) {
|
||||
$tmpop = collect($field[$field['type']]['options'])->first(function ($op) use ($val) {
|
||||
return ($op['id'] === $val);
|
||||
return ($op['id'] ?? $op['value'] === $val);
|
||||
});
|
||||
return isset($tmpop['name']) ? $tmpop['name'] : "";
|
||||
}, $data[$field['id']]);
|
||||
|
||||
@@ -126,7 +126,7 @@ abstract class UserFormRequest extends \Illuminate\Foundation\Http\FormRequest
|
||||
|
||||
// Custom SEO
|
||||
'seo_meta' => 'nullable|array',
|
||||
'custom_domain' => 'sometimes|nullable|regex:/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}$/'
|
||||
'custom_domain' => 'sometimes|nullable|regex:/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,20}$/'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class CustomDomainRequest extends FormRequest
|
||||
$domains = collect($value)->filter(function ($domain) {
|
||||
return !empty( trim($domain) );
|
||||
})->each(function($domain) use (&$errors) {
|
||||
if (!preg_match('/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}$/', $domain)) {
|
||||
if (!preg_match('/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,20}$/', $domain)) {
|
||||
$errors[] = 'Invalid domain: ' . $domain;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -50,7 +50,8 @@ class FormResource extends JsonResource
|
||||
'notification_settings' => $this->notification_settings,
|
||||
'removed_properties' => $this->removed_properties,
|
||||
'last_edited_human' => $this->updated_at?->diffForHumans(),
|
||||
'seo_meta' => $this->seo_meta
|
||||
'seo_meta' => $this->seo_meta,
|
||||
'max_file_size' => $this->max_file_size / 1000000,
|
||||
] : [];
|
||||
|
||||
$baseData = $this->getFilteredFormData(parent::toArray($request), $this->userIsFormOwner());
|
||||
|
||||
Reference in New Issue
Block a user