(bugfix) Fix proof of payment download URL to use shareID with checksum

Fixed bug where proof of payment download links used raw locationID instead
of shareID (locationID + checksum), causing link validation to fail. Added
AsyncLink component to handle async shareID generation gracefully.

Changes:
- BillEditForm: Generate shareID using generateShareId server action
- BillEditForm: Use AsyncLink to prevent broken links during async load
- AsyncLink: New reusable component for links that need async data
- Updated download URL from locationID-billID to shareID-billID format

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-09 18:16:53 +01:00
parent 37f617683e
commit e318523887
2 changed files with 34 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
import React from "react";
import Link from "next/link";
/** Link component that can be disabled */
export const AsyncLink: React.FC<{ href: string; children: React.ReactNode, target?: string, className?: string, disabled?: boolean }> = ({ href, children, target, className, disabled }) =>
disabled ? <span className={className}>{children}</span> :
<Link
href={href}
target={target}
className={className}
>
{children}
</Link>