master
Andrey 2024-05-17 15:35:09 +03:00
parent adac5fe9f4
commit 4375700e2b
2 changed files with 1 additions and 3 deletions

View File

@ -10,7 +10,7 @@ use Illuminate\Http\JsonResponse;
class FeedbackForms extends FormsService { class FeedbackForms extends FormsService {
public function store(array $data): ?JsonResponse { public function store(array $data): ?JsonResponse {
if ($objectType = ObjectType::byUuid($data['type'] ?? null)->first()) { if ($objectType = ObjectType::byUuidOrName($data['type'] ?? null)->first()) {
$object = $objectType->objects()->create(); $object = $objectType->objects()->create();
$object->setValues($data); $object->setValues($data);
if (!empty($data['mailto'])) event(new FeedbackFormSubmitted($object, $data['mailto'])); if (!empty($data['mailto'])) event(new FeedbackFormSubmitted($object, $data['mailto']));

View File

@ -74,6 +74,4 @@ class FormsService {
return ['id' => $name, 'title' => $title]; return ['id' => $name, 'title' => $title];
})->values()->all()]; })->values()->all()];
} }
} }