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]);