mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix(WarehouseTransfer).
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { FormikObserver } from 'components';
|
||||
import { useWarehouseTransferFormContext } from './WarehouseTransferFormProvider';
|
||||
|
||||
export function WarehouseTransferObserveItemsCost() {
|
||||
const { setItemCostQuery } = useWarehouseTransferFormContext();
|
||||
|
||||
// Handle the form change.
|
||||
const handleFormChange = (values) => {
|
||||
const itemsIds = values.entries
|
||||
.filter((e) => e.item_id)
|
||||
.map((e) => e.item_id);
|
||||
|
||||
setItemCostQuery({
|
||||
date: values.date,
|
||||
itemsIds,
|
||||
});
|
||||
};
|
||||
return <FormikObserver onChange={handleFormChange} />;
|
||||
}
|
||||
Reference in New Issue
Block a user