From 8b91f8c7f8d7fe70fe869b91c12702512a9b45c0 Mon Sep 17 00:00:00 2001 From: anazaryan Date: Thu, 19 Dec 2024 14:47:40 +0400 Subject: [PATCH] fix vacancy autolift --- app/Http/Controllers/EmployerController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 139b21b..d34380f 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -859,12 +859,14 @@ class EmployerController extends Controller ); foreach ($request->get('vacancies') as $vacancy) { - Ad_employer::query() - ->where('id', $vacancy['id']) - ->update([ - 'autolift_site' => $vacancy['autolift_site'] === 'true', //they're arriving as strings - 'autosend_tg' => $vacancy['autosend_tg'] === 'true', - ]); + if ($vacancy['autolift_site']) { + Ad_employer::query() + ->where('id', $vacancy['id']) + ->update([ + 'autolift_site' => $vacancy['autolift_site'] === 'true', //they're arriving as strings + 'autosend_tg' => $vacancy['autosend_tg'] === 'true', + ]); + } } return response(['success' => true]); -- 1.7.10.4