sneha #98
@@ -181,7 +181,7 @@ class DeviceController extends Controller
|
||||
|
||||
|
||||
public function devicelistCustomer($customerId)
|
||||
{
|
||||
{
|
||||
try {
|
||||
$devices = Device::with('deviceProfile:id,name', 'customer:id,name')
|
||||
->where('customer_id', $customerId)
|
||||
@@ -198,7 +198,7 @@ class DeviceController extends Controller
|
||||
});
|
||||
|
||||
if ($devices->isEmpty()) {
|
||||
return response()->json(['message' => 'No devices found for this customer ID'], 404);
|
||||
return response()->json(['message' => 'No devices found for this customer ID'], 200);
|
||||
}
|
||||
|
||||
return jsonResponseWithSuccessMessage('Devices fetched successfully', [
|
||||
|
||||
@@ -519,7 +519,6 @@ class UsersController extends Controller
|
||||
'real_email' => $user->email,
|
||||
// 'tb_email' => $dummyEmail
|
||||
], 200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error("ThingsBoard activation failed: " . $e->getMessage());
|
||||
|
||||
@@ -539,7 +538,6 @@ class UsersController extends Controller
|
||||
'error' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error("Error activating user ID: {$id}. Exception: " . $e->getMessage());
|
||||
return response()->json([
|
||||
@@ -743,7 +741,7 @@ class UsersController extends Controller
|
||||
});
|
||||
|
||||
if ($users->isEmpty()) {
|
||||
return response()->json(['message' => 'No users found for this customer ID'], 404);
|
||||
return response()->json(['message' => 'No users found for this customer ID'], 200);
|
||||
}
|
||||
|
||||
return jsonResponseWithSuccessMessage('Users fetched successfully', [
|
||||
@@ -754,5 +752,4 @@ class UsersController extends Controller
|
||||
return jsonResponseWithErrorMessage($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user