Add missing endpoint on api Interface contructor

This commit is contained in:
Jérémy Munsch 2021-08-13 11:12:21 +02:00
parent 9292cb029b
commit af77f52bed
2 changed files with 4 additions and 2 deletions

View file

@ -22,9 +22,10 @@ class CrmApiV2
*/
private static $apiInterface;
public function __construct(string $bearerToken = null, string $bearerPwd = null)
public function __construct(string $endpoint = null, string $bearerToken = null, string $bearerPwd = null)
{
self::$apiInterface = self::$apiInterface ?: new ApiInterface(
$endpoint,
$bearerToken,
$bearerPwd
);

View file

@ -58,8 +58,9 @@ class ApiInterface
*/
protected static $apiToken;
public function __construct(string $bearerToken = null, string $bearerPwd = null)
public function __construct(string $endpoint = null, string $bearerToken = null, string $bearerPwd = null)
{
static::$endpoint = static::$endpoint ?: $endpoint;
static::$bearerToken = static::$bearerToken ?: $bearerToken;
static::$bearerPwd = static::$bearerPwd ?: $bearerPwd;
static::$bearerToken = static::$bearerToken ?: Utils::getConfig('crm.token');