Update FilamentStock model to conditionally return startingWeight based on object state type

This commit is contained in:
Tom Butcher 2025-11-17 18:51:17 +00:00
parent e3c7f24c48
commit c2f55a5967

View File

@ -84,7 +84,7 @@ export const FilamentStock = {
required: true, required: true,
columnWidth: 300, columnWidth: 300,
value: (objectData) => { value: (objectData) => {
if (!objectData.currentWeight) { if (objectData?.state?.type === 'unconsumed') {
return objectData?.startingWeight return objectData?.startingWeight
} else { } else {
return objectData.currentWeight return objectData.currentWeight