Alarm api admin issue fixed
This commit is contained in:
@@ -1559,17 +1559,22 @@ class TelemetryController extends Controller
|
||||
|
||||
public function getAdminAlarms(Request $request){
|
||||
try {
|
||||
$getDeviceByAsset = Device::whereIn('asset_id', $request->assetIds)->pluck('id')->toArray();
|
||||
if($request->assetIds){
|
||||
$getDeviceByAsset = Device::whereIn('asset_id', $request->assetIds)->pluck('id')->toArray();
|
||||
}else{
|
||||
$getDeviceByAsset = $request->deviceIds;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'statusList' => $request->statusList,
|
||||
'statusList' => $request->statusList ?? ['ACTIVE'],
|
||||
'severityList' => $request->severityList,
|
||||
'startTs' => $request->startTs,
|
||||
'endTs' => $request->endTs,
|
||||
'deviceIds' => $request->deviceIds ?? $getDeviceByAsset,
|
||||
'deviceIds' => $getDeviceByAsset,
|
||||
];
|
||||
|
||||
$allDevices = Device::pluck('id')->toArray();
|
||||
|
||||
$alarms = $this->customerInfoService->fetchDeviceAlarms($allDevices, $data);
|
||||
|
||||
return response()->json(['success' => true, 'data' => $alarms]);
|
||||
|
||||
Reference in New Issue
Block a user