fix service simbg login token and fix create new users

This commit is contained in:
arifal
2025-01-30 12:10:42 +07:00
parent 8591fafd84
commit 1f6ef5f110
7 changed files with 54 additions and 20 deletions

View File

@@ -118,7 +118,7 @@ class ServiceSIMBG
'page' => 1,
'size' => 20,
'sort' => 'ASC',
'type' => 'task',
// 'type' => 'task',
]);
$url = "/api/pbg/v1/list/?" . $queryParams;
@@ -139,11 +139,16 @@ class ServiceSIMBG
$failedCount = 0;
for ($currentPage = 1; $currentPage <= $totalPage; $currentPage++) {
$token = $this->getToken();
$simbg_token = $token->original['data']['token']['access'];
$headers = ['Authorization' => "Bearer " . $simbg_token];
$queryParams = http_build_query([
'page' => $currentPage,
'size' => 20,
'sort' => 'ASC',
'type' => 'task'
// 'type' => 'task'
]);
$url = "/api/pbg/v1/list/?" . $queryParams;
@@ -190,6 +195,7 @@ class ServiceSIMBG
// Synchronize additional details
$this->syncIndexIntegration($item['uid']);
$this->syncTaskDetailSubmit($item['uid']);
Log::info("executed page: ". $currentPage);
$savedCount++;
} catch (Exception $e) {
$importDatasource->update([