From 0789ad8924ff869c25cd34b581f7a9f50686b6f4 Mon Sep 17 00:00:00 2001 From: ibnu Date: Wed, 15 Mar 2023 07:31:11 +0700 Subject: [PATCH] update progress import --- app/Http/Controllers/ActivityController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index bf480ee..467147d 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -393,12 +393,12 @@ class ActivityController extends Controller { $data = $request->all(); $data['created_by'] = $this->currentName; - Activity::where('version_gantt_id', $data['ganttId'])->delete(); - $projectId = VersionGantt::where('id', $data['ganttId'])->first()->proyek_id; + Activity::where('version_gantt_id', $data['gantt_id'])->delete(); + $projectId = VersionGantt::where('id', $data['gantt_id'])->first()->proyek_id; // get data excel - $excel = TmpImport::lates('id')->first(); + $excel = TmpImport::latest('id')->first(); - return response()->json(['stack' => $excel, 'status' => 'success', 'message' => 'Data imported!', 'projectId' => $projectId, 'code' => 200], 200); + return response()->json(['stack' => $excel, 'status' => 'success', 'message' => 'Data imported!', 'data' => $data, 'code' => 200], 200); } public function uploadTmpImport(Request $request) @@ -411,7 +411,7 @@ class ActivityController extends Controller $result = $document->move($this->pathTmpImport, $name); if($result){ $data = [ - 'ref_id' => (int)$gantt_id, + 'gantt_id' => (int)$gantt_id, 'file' => $name, 'type_dokumen' => $request->type_dokumen ];