From 20326961e36d5204f38f0594d92b29b877affbbd Mon Sep 17 00:00:00 2001 From: wahyu Date: Fri, 22 Dec 2023 11:07:02 +0700 Subject: [PATCH] fix open scurve error --- app/Http/Controllers/ProjectController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 104b128..b4d963d 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -581,10 +581,12 @@ class ProjectController extends Controller $plannedEnd = Activity::where('version_gantt_id', $ganttId) ->orderByDesc('planned_end') ->value('planned_end'); - $result->header->start_date = $startDate; - $result->header->end_date = $maxEndDate->end_date; - $result->header->planned_start = $plannedStart; - $result->header->planned_end = $plannedEnd; + if (isset($result->header)) { + $result->header->start_date = $startDate; + $result->header->end_date = $maxEndDate->end_date; + $result->header->planned_start = $plannedStart; + $result->header->planned_end = $plannedEnd; + } return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$ganttId], 200); }