Commit 8b91f8c7f8d7fe70fe869b91c12702512a9b45c0
1 parent
17934ed8c0
Exists in
master
fix vacancy autolift
Showing 1 changed file with 8 additions and 6 deletions Side-by-side Diff
app/Http/Controllers/EmployerController.php
... | ... | @@ -859,12 +859,14 @@ class EmployerController extends Controller |
859 | 859 | ); |
860 | 860 | |
861 | 861 | foreach ($request->get('vacancies') as $vacancy) { |
862 | - Ad_employer::query() | |
863 | - ->where('id', $vacancy['id']) | |
864 | - ->update([ | |
865 | - 'autolift_site' => $vacancy['autolift_site'] === 'true', //they're arriving as strings | |
866 | - 'autosend_tg' => $vacancy['autosend_tg'] === 'true', | |
867 | - ]); | |
862 | + if ($vacancy['autolift_site']) { | |
863 | + Ad_employer::query() | |
864 | + ->where('id', $vacancy['id']) | |
865 | + ->update([ | |
866 | + 'autolift_site' => $vacancy['autolift_site'] === 'true', //they're arriving as strings | |
867 | + 'autosend_tg' => $vacancy['autosend_tg'] === 'true', | |
868 | + ]); | |
869 | + } | |
868 | 870 | } |
869 | 871 | |
870 | 872 | return response(['success' => true]); |