mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
fix for returning token on company creation
This commit is contained in:
parent
710732a1fb
commit
0469de7466
@ -234,7 +234,7 @@ class CompanyController extends BaseController
|
||||
$this->entity_type = CompanyUser::class;
|
||||
|
||||
//return $this->itemResponse($company);
|
||||
$ct = CompanyUser::whereUserId(auth()->user()->id);
|
||||
$ct = CompanyUser::whereUserId(auth()->user()->id)->whereCompanyId($company->id);
|
||||
|
||||
return $this->listResponse($ct);
|
||||
|
||||
|
@ -55,9 +55,12 @@ class CompanyUser extends Pivot
|
||||
return $this->hasOne(Company::class, 'id', 'company_id');
|
||||
}
|
||||
|
||||
/*todo monitor this function - may fail under certain conditions*/
|
||||
public function token()
|
||||
{
|
||||
return $this->belongsTo(CompanyToken::class, 'user_id','user_id');
|
||||
|
||||
/*
|
||||
return $this->hasOneThrough(
|
||||
CompanyToken::class,
|
||||
CompanyUser::class,
|
||||
@ -66,6 +69,6 @@ class CompanyUser extends Pivot
|
||||
'user_id', // Local key on CompanyToken table...
|
||||
'company_id' // Local key on CompanyUser table...
|
||||
);
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user