Skip to content

Commit

Permalink
Merge pull request #842 from bakaphp/development
Browse files Browse the repository at this point in the history
fix: agent signup
  • Loading branch information
kaioken authored Jan 26, 2024
2 parents b541437 + 900d177 commit 8398daa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Domains/Connectors/Zoho/Workflows/ZohoAgentActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Baka\Users\Contracts\UserInterface;
use Exception;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use Kanvas\Companies\Models\Companies;
use Kanvas\Connectors\Zoho\Client;
use Kanvas\Connectors\Zoho\Enums\CustomFieldEnum;
use Kanvas\Connectors\Zoho\ZohoService;
use Kanvas\Guild\Agents\Models\Agent;
Expand Down Expand Up @@ -86,10 +86,13 @@ protected function createAgent(AppInterface $app, ZohoService $zohoService, User
$userInvite = UsersInvite::fromCompany($company)->fromApp($app)->where('email', $user->email)->firstOrFail();
$agentOwner = Agent::fromCompany($company)->where('users_id', $userInvite->users_id)->firstOrFail();
$ownerInfo = $zohoService->getAgentByMemberNumber((string) $agentOwner->member_id);
Log::info('owner info', [$ownerInfo]);

$ownerId = $ownerInfo->Owner['id'];
$ownerId = $ownerInfo->id;
$ownerMemberNumber = $ownerInfo->Member_Number;
} catch(Exception $e) {
//log the error
Log::error($e->getMessage() . ' error creating agent');
$agentOwner = null;
$ownerMemberNumber = null;
}
Expand Down

0 comments on commit 8398daa

Please sign in to comment.