fixing bug that would show the previous harvest plan when you click on a field that does not have one set without closing the drawer first

This commit is contained in:
csawatzky 2026-02-10 15:59:26 -06:00
parent e9281b2812
commit 43f817c875

View file

@ -134,7 +134,8 @@ export default function FieldDrawer(props: Props) {
hPlanAPI
.listHarvestPlans(1, 0, "desc", "createDate", field.key(), as)
.then(resp => {
if (resp.data.harvestPlan.length > 0) {
console.log(resp)
if (resp.data.harvestPlan) {
let plan = resp.data.harvestPlan[0];
setHPlan(HarvestPlan.any(plan));
} else {