Skip to content

Commit

Permalink
Merge pull request #135 from Thomas-More-Digital-Innovation/sva-delet…
Browse files Browse the repository at this point in the history
…e_client_fix

Delete client now also deletes questionUserList and Answer belonging …
  • Loading branch information
SiebeCamerman authored Jan 8, 2024
2 parents 7da95a8 + 582ddca commit 8f0f010
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/webapp/app/Http/Controllers/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Http\Controllers;

use App\Http\Requests\StoreUserRequest;
use App\Models\Answer;
use App\Models\QuestionUserList;
use App\Models\Department;
use App\Models\DepartmentList;
use App\Models\Info;
Expand Down Expand Up @@ -208,6 +210,8 @@ public function destroy($id)

DepartmentList::where("user_id", $id)->delete();
UserList::where("client_id", $id)->delete();
Answer::where("user_id", $id)->delete();
QuestionUserList::where("user_id", $id)->delete();
$client = User::find($id);
$client->delete();

Expand Down

0 comments on commit 8f0f010

Please sign in to comment.