sneha #98

Merged
Sneha.Yadav merged 2 commits from sneha into main 2025-04-24 08:04:50 +00:00
2 changed files with 4 additions and 7 deletions

View File

@@ -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', [

View File

@@ -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);
}
}
}
}