1
0
forked from poc/pds

Updated item selection logic in StickerMasterResource to return an empty array when no plant is selected

This commit is contained in:
dhanabalan
2025-12-01 14:53:15 +05:30
parent 91deb448ef
commit 035e6cd560

View File

@@ -620,9 +620,7 @@ class StickerMasterResource extends Resource
->options(function (callable $get) { ->options(function (callable $get) {
$plantId = $get('Plant'); $plantId = $get('Plant');
return $plantId return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
? Item::where('plant_id', $plantId)->pluck('code', 'id')
: Item::pluck('code', 'id');
}) })
->searchable() ->searchable()
->reactive(), ->reactive(),