(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:
13
web-app/app/ui/AsyncLink.tsx
Normal file
13
web-app/app/ui/AsyncLink.tsx
Normal 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>
|
||||
Reference in New Issue
Block a user