Browse Source

fix(project): fixed project delete

pull/1/head
Watiah11 6 months ago
parent
commit
4a4e912ed0
  1. 6
      app/Http/Controllers/ProjectController.php

6
app/Http/Controllers/ProjectController.php

@ -181,9 +181,9 @@ class ProjectController extends Controller
$data = Project::find($id); $data = Project::find($id);
$dateNow = Carbon::now(); $dateNow = Carbon::now();
if ($data) { if ($data) {
// $this->deleteRelative($id, $company_id); $this->deleteRelative($id, $company_id);
// if ($data->delete()) { if ($data->delete()) {
if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) { // if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) {
DB::commit(); DB::commit();
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200);
} else { } else {

Loading…
Cancel
Save