fix: fix faulty relationship query preventing form deletion
Fixes #12. Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
parent
1b7c144497
commit
73a674096a
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user