2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 19:46:46 +00:00

Fix for react hook (#7151)

* Fix for react hook

* Improve quantity input
This commit is contained in:
Oliver 2024-05-03 20:13:36 +10:00 committed by GitHub
parent acfd50372d
commit 7f12d55609
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -143,7 +143,6 @@ function StockItemDefaultMove({
stockItem: any; stockItem: any;
value: any; value: any;
}) { }) {
console.log('item', stockItem);
const { data } = useSuspenseQuery({ const { data } = useSuspenseQuery({
queryKey: [ queryKey: [
'location', 'location',
@ -289,7 +288,7 @@ function StockOperationsRow({
} else { } else {
return `#${record.serial}`; return `#${record.serial}`;
} }
}, record); }, [record]);
return ( return (
<tr> <tr>
@ -317,6 +316,7 @@ function StockOperationsRow({
<NumberInput <NumberInput
value={value} value={value}
onChange={onChange} onChange={onChange}
disabled={!!record.serial && record.quantity == 1}
max={setMax ? record.quantity : undefined} max={setMax ? record.quantity : undefined}
min={0} min={0}
style={{ maxWidth: '100px' }} style={{ maxWidth: '100px' }}