Added routine and category values in get method

This commit is contained in:
dhanabalan
2025-06-03 19:32:54 +05:30
parent dec8a5b972
commit 894f2a0e85

View File

@@ -385,6 +385,8 @@ class TestingPanelController extends Controller
// Get description or empty string if not found // Get description or empty string if not found
$description = $item ? $item->description : ''; $description = $item ? $item->description : '';
$category = $item ? $item->category : '';
if ($plantCode === null || $plantCode === '') if ($plantCode === null || $plantCode === '')
{ {
// return response("ERROR: Plant Name can't be empty", 400) // return response("ERROR: Plant Name can't be empty", 400)
@@ -421,7 +423,7 @@ class TestingPanelController extends Controller
{ {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item Code not found for plant : $plant->name" 'status_description' => "Item Code not found in item table for the plant : $plant->name"
], 404); ], 404);
} }
@@ -433,7 +435,7 @@ class TestingPanelController extends Controller
{ {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item Code not found in master for the plant : $plant->name" 'status_description' => "Item Code not found in master table for the plant : $plant->name"
], 404); ], 404);
} }
@@ -451,6 +453,8 @@ class TestingPanelController extends Controller
"mot_conn" => $motorTestingMaster->connection ?? "", "mot_conn" => $motorTestingMaster->connection ?? "",
"mot_ins_res_limit" => $motorTestingMaster->ins_res_limit ?? "", "mot_ins_res_limit" => $motorTestingMaster->ins_res_limit ?? "",
"mot_ins_res_type" => $motorTestingMaster->ins_res_type ?? "", "mot_ins_res_type" => $motorTestingMaster->ins_res_type ?? "",
"mot_category" => $category ?? "",
"mot_routine_test_time" => $motorTestingMaster->routine_test_time ?? "",
"mot_res_ry_ll" => $motorTestingMaster->res_ry_ll ?? "", "mot_res_ry_ll" => $motorTestingMaster->res_ry_ll ?? "",
"mot_res_ry_ul" => $motorTestingMaster->res_ry_ul ?? "", "mot_res_ry_ul" => $motorTestingMaster->res_ry_ul ?? "",
"mot_res_yb_ll" => $motorTestingMaster->res_yb_ll ?? "", "mot_res_yb_ll" => $motorTestingMaster->res_yb_ll ?? "",