Status set to 400

This commit is contained in:
2025-06-19 17:31:24 +05:30
parent 1e2043aeac
commit cc321aebe8
3 changed files with 5 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ class DeviceController extends Controller
$deviceNameExists = Device::where('name', $request->name)->first();
if (empty($request->id) && $deviceNameExists) {
return response()->json(['status' => 'error','message' => 'Device name already exists'],400);
return jsonResponseWithErrorMessage('Device name already exists', 400);
}
$deviceData = [
@@ -67,7 +67,7 @@ class DeviceController extends Controller
$deviceNameExists = Device::where('name', $request->name)->where('id','!=',$request->id)->first();
if ($deviceNameExists) {
return response()->json(['status' => 'error','message' => 'Device name already exists'],400);
return jsonResponseWithErrorMessage('Device name already exists', 400);
}
}
if (!empty($request->firmwareId)) {