Remove redundant stockType field mapping, refactor location handling in identifier mapper, and update related tests.
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
2026-04-11 02:33:47 +02:00
parent 9e3245a427
commit ca9517508d
2 changed files with 24 additions and 11 deletions
@@ -118,7 +118,6 @@ export function mapLookupItemToForm({
setField('identifierCode', textValue('identifier_code'));
setField('name', textValue('name'));
setField('description', textValue('description'));
setField('stockType', textValue('stock_type'));
setField('level', textValue('level'));
setField('quantity', numberValue('quantity_initial'));
setField('uom', textValue('uom_symbol'));
@@ -138,14 +137,14 @@ export function mapLookupItemToForm({
setField('expirationDate', '');
}
const canSetLocation = !String(nextForm.locationId || '').trim();
const locationUuid = nonEmptyText(lookupItem?.location_initial_uuid_b64);
if (canSetLocation && locationUuid) {
if (locationUuid) {
const matchingLocation = locations.find((entry) => entry.uuid_b64 === locationUuid);
if (matchingLocation) {
nextForm.locationId = String(matchingLocation.id);
nextLocationSearch = matchingLocation.name;
didUpdate = true;
setField('locationId', String(matchingLocation.id));
if (nextLocationSearch !== matchingLocation.name) {
nextLocationSearch = matchingLocation.name;
}
}
}