diff --git a/app/api/suppliers/[id]/route.ts b/app/api/suppliers/[id]/route.ts index 2471204..3fc80c3 100644 --- a/app/api/suppliers/[id]/route.ts +++ b/app/api/suppliers/[id]/route.ts @@ -29,6 +29,7 @@ export async function PATCH(req: Request, { params }: { params: Promise<{ id: st if (!Object.keys(patch).length) return Response.json({ ok: false, error: "Nothing to change." }, { status: 400 }); await pb.collection("suppliers").update(id, patch); revalidatePath("/expenses/suppliers"); + revalidatePath("/expenses/suppliers-2"); return Response.json({ ok: true }); } catch (e: any) { return Response.json({ ok: false, error: e?.message || "Could not save" }, { status: 500 }); diff --git a/components/PurchaseIntake.tsx b/components/PurchaseIntake.tsx index 6b143c2..5c7e035 100644 --- a/components/PurchaseIntake.tsx +++ b/components/PurchaseIntake.tsx @@ -66,6 +66,8 @@ export function PurchaseIntake({ purchases: allPurchases }: { purchases: Purchas const [offset, setOffset] = useState(0); const [groupBySupplier, setGroupBySupplier] = useState(true); const [dragging, setDragging] = useState(false); + // Deleting and correcting are hidden until this is switched on, and it resets on reload. + const [editMode, setEditMode] = useState(false); // Drop a PO anywhere on the page. Not while the invoice window is open: that has its own // drop area, and an invoice PDF must never be read as a purchase order. const dropProps = { @@ -237,7 +239,16 @@ export function PurchaseIntake({ purchases: allPurchases }: { purchases: Purchas className="min-h-[44px] min-w-[44px] grid place-items-center rounded-lg hover:bg-gray-100 dark:hover:bg-white/5 disabled:opacity-30"> )} -