Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.

Commit 2e162ea

Browse files
author
Edi Santoso
committed
feat: now can delete data
1 parent c23f5ef commit 2e162ea

File tree

6 files changed

+306
-182
lines changed

6 files changed

+306
-182
lines changed

app/Http/Controllers/Api/UserController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public function update(UserEditRequest $request, $id){
3333

3434
public function destroy($id){
3535
$user = User::find($id);
36-
return $user->delete();
36+
$result = $user->delete();
37+
if($result){
38+
return response()->json(['message' =>'Data deleted!'], 200);
39+
}
40+
41+
return response()->json(['message' =>'something wrong'], 500);
3742
}
3843
}

0 commit comments

Comments
 (0)