mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 03:44:34 -04: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;
|
$this->entity_type = CompanyUser::class;
|
||||||
|
|
||||||
//return $this->itemResponse($company);
|
//return $this->itemResponse($company);
|
||||||
$ct = CompanyUser::whereUserId(auth()->user()->id);
|
$ct = CompanyUser::whereUserId(auth()->user()->id)->whereCompanyId($company->id);
|
||||||
|
|
||||||
return $this->listResponse($ct);
|
return $this->listResponse($ct);
|
||||||
|
|
||||||
|
@ -55,9 +55,12 @@ class CompanyUser extends Pivot
|
|||||||
return $this->hasOne(Company::class, 'id', 'company_id');
|
return $this->hasOne(Company::class, 'id', 'company_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*todo monitor this function - may fail under certain conditions*/
|
||||||
public function token()
|
public function token()
|
||||||
{
|
{
|
||||||
|
return $this->belongsTo(CompanyToken::class, 'user_id','user_id');
|
||||||
|
|
||||||
|
/*
|
||||||
return $this->hasOneThrough(
|
return $this->hasOneThrough(
|
||||||
CompanyToken::class,
|
CompanyToken::class,
|
||||||
CompanyUser::class,
|
CompanyUser::class,
|
||||||
@ -66,6 +69,6 @@ class CompanyUser extends Pivot
|
|||||||
'user_id', // Local key on CompanyToken table...
|
'user_id', // Local key on CompanyToken table...
|
||||||
'company_id' // Local key on CompanyUser table...
|
'company_id' // Local key on CompanyUser table...
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user