diff --git a/app/Form.php b/app/Form.php index 80220fc..59afbae 100755 --- a/app/Form.php +++ b/app/Form.php @@ -40,6 +40,6 @@ class Form extends Model public function responses() { - return $this->belongsTo('App\Response', 'id', 'id'); + return $this->belongsTo('App\Response', 'id', 'responseFormID'); } } diff --git a/app/Services/FormManagementService.php b/app/Services/FormManagementService.php index a7e9ce0..0a59544 100755 --- a/app/Services/FormManagementService.php +++ b/app/Services/FormManagementService.php @@ -39,7 +39,7 @@ class FormManagementService $deletable = true; - if (! is_null($form) && ! is_null($form->vacancies) && $form->vacancies->count() !== 0 || ! is_null($form->responses)) { + if (! is_null($form->vacancies) && $form->vacancies->count() !== 0 || ! is_null($form->responses)) { $deletable = false; }