asdfsafd
This commit is contained in:
@@ -238,12 +238,12 @@ const AdminProducts = () => {
|
||||
}
|
||||
|
||||
// For custom seed products, parse activeIngredients JSON for blend and seed rates
|
||||
if (!product.isShared && productType === 'seed' && product.customActiveIngredients) {
|
||||
if (!product.isShared && productType === 'seed' && product.activeIngredients) {
|
||||
try {
|
||||
const ai = typeof product.customActiveIngredients === 'string' ? JSON.parse(product.customActiveIngredients) : product.customActiveIngredients;
|
||||
const ai = typeof product.activeIngredients === 'string' ? JSON.parse(product.activeIngredients) : product.activeIngredients;
|
||||
if (Array.isArray(ai?.seedBlend)) nextSeedBlend = ai.seedBlend;
|
||||
if (ai?.seedRates) {
|
||||
const unit = ai.seedRates.unit || product.customRateUnit || 'lbs/1000 sq ft';
|
||||
const unit = ai.seedRates.unit || product.rateUnit || 'lbs/1000 sq ft';
|
||||
const rates = [];
|
||||
if (ai.seedRates.new) rates.push({ applicationType: 'New Lawn', rateAmount: ai.seedRates.new, rateUnit: unit, notes: '' });
|
||||
if (ai.seedRates.overseed) rates.push({ applicationType: 'Overseeding', rateAmount: ai.seedRates.overseed, rateUnit: unit, notes: '' });
|
||||
@@ -262,8 +262,8 @@ const AdminProducts = () => {
|
||||
seedBlend: nextSeedBlend,
|
||||
rates: nextRates.length > 0 ? nextRates : [{
|
||||
applicationType: productType,
|
||||
rateAmount: product.customRateAmount || '',
|
||||
rateUnit: product.customRateUnit || 'lbs/1000 sq ft',
|
||||
rateAmount: product.rateAmount || '',
|
||||
rateUnit: product.rateUnit || 'lbs/1000 sq ft',
|
||||
notes: ''
|
||||
}]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user