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 ];