Skip to content

Commit

Permalink
Merge pull request #265 from deanblackborough/master
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
deanblackborough authored Jun 24, 2023
2 parents d6621f4 + 5887df8 commit 9fa4b67
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/Jobs/MigrateBudgetItemsToBudgetPro.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function handle()
$budget_pro_model->end_date = $item->end_date;
$budget_pro_model->disabled = $item->disabled;
$budget_pro_model->frequency = $item->frequency;
$budget_pro_model->created_at = 'NOW()';
$budget_pro_model->created_at = $item_model->created_at;
$budget_pro_model->save();
}

Expand All @@ -134,20 +134,20 @@ public function handle()
$resource->data = $budget_resource_data;
$resource->save();
}

$cache_clear_payload = (new \App\Cache\JobPayload())
->setGroupKey(\App\Cache\KeyGroup::RESOURCE_DELETE)
->setRouteParameters([
'resource_type_id' => $budget_pro_resource_type_id,
'resource_id' => $budget_pro_resource_id
])
->setUserId($this->user_id);

ClearCache::dispatchSync($cache_clear_payload->payload());
});
} catch (\Exception) {
$this->fail(new \Exception('Failed to create all the items or save the resource data'));
}

$cache_clear_payload = (new \App\Cache\JobPayload())
->setGroupKey(\App\Cache\KeyGroup::RESOURCE_DELETE)
->setRouteParameters([
'resource_type_id' => $budget_pro_resource_type_id,
'resource_id' => $budget_pro_resource_id
])
->setUserId($this->user_id);

ClearCache::dispatchSync($cache_clear_payload->payload());
}

public function fetchBudgetItems(int $resource_id): array
Expand Down

0 comments on commit 9fa4b67

Please sign in to comment.