Skip to content

Commit

Permalink
Fix for stock item edit
Browse files Browse the repository at this point in the history
- Pass stockItem instance through to form
  • Loading branch information
SchrodingersGat committed Nov 8, 2024
1 parent fade7e3 commit 4c2900f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/frontend/src/pages/stock/StockDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ export default function StockDetail() {

const editStockItemFields = useStockFields({
create: false,
stockItem: stockitem,
partId: stockitem.part
});

Expand Down
7 changes: 5 additions & 2 deletions src/frontend/src/tables/stock/StockItemTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,15 @@ export function StockItemTable({
};
}, [table]);

const stockItemFields = useStockFields({ create: true, partId: params.part });
const newStockItemFields = useStockFields({
create: true,
partId: params.part
});

const newStockItem = useCreateApiFormModal({
url: ApiEndpoints.stock_item_list,
title: t`Add Stock Item`,
fields: stockItemFields,
fields: newStockItemFields,
initialData: {
part: params.part,
location: params.location
Expand Down

0 comments on commit 4c2900f

Please sign in to comment.