Browse Source

fix(project): fixed project delete

pull/1/head
Watiah11 8 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);
$dateNow = Carbon::now();
if ($data) {
// $this->deleteRelative($id, $company_id);
// if ($data->delete()) {
if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) {
$this->deleteRelative($id, $company_id);
if ($data->delete()) {
// if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) {
DB::commit();
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200);
} else {

Loading…
Cancel
Save