fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -18,7 +18,13 @@ export default function InvestmentContexts({
|
||||
}: {
|
||||
contexts: InvestmentContext[];
|
||||
contentSource?: LegacyArticle;
|
||||
zoneSource?: { zone_id: string; consulted_public_version: number; title: string; href: string; notice: string };
|
||||
zoneSource?: {
|
||||
zone_id: string;
|
||||
consulted_public_version: number;
|
||||
title: string;
|
||||
href: string;
|
||||
notice: string;
|
||||
};
|
||||
sectorSource?: { id: number; name: string; slug: string; href: string };
|
||||
}) {
|
||||
const [key] = useState(() => createOperationKey());
|
||||
@@ -36,7 +42,14 @@ export default function InvestmentContexts({
|
||||
<main className="mx-auto max-w-5xl space-y-6 p-4 md:p-8">
|
||||
<Head title="Os meus investimentos" />
|
||||
<h1 className="text-2xl font-semibold">Os meus investimentos</h1>
|
||||
{zoneSource && <section className="rounded border p-4"><h2>Parque escolhido: {zoneSource.title}</h2><Link className="underline" href={zoneSource.href}>Consultar parque</Link></section>}
|
||||
{zoneSource && (
|
||||
<section className="rounded border p-4">
|
||||
<h2>Parque escolhido: {zoneSource.title}</h2>
|
||||
<Link className="underline" href={zoneSource.href}>
|
||||
Consultar parque
|
||||
</Link>
|
||||
</section>
|
||||
)}
|
||||
{sectorSource && (
|
||||
<p>
|
||||
Preparar uma ideia em{' '}
|
||||
@@ -73,7 +86,26 @@ export default function InvestmentContexts({
|
||||
Guardado em{' '}
|
||||
{new Date(item.updated_at).toLocaleString('pt-MZ')}
|
||||
</p>
|
||||
{zoneSource && <button type="button" className="mt-3 rounded border p-2" onClick={()=>router.post(`/investimentos/${item.id}/parques`,{version:item.version,zone_id:zoneSource.zone_id,consulted_public_version:zoneSource.consulted_public_version,confirm:true})}>Confirmar referência neste dossier</button>}
|
||||
{zoneSource && (
|
||||
<button
|
||||
type="button"
|
||||
className="mt-3 rounded border p-2"
|
||||
onClick={() =>
|
||||
router.post(
|
||||
`/investimentos/${item.id}/parques`,
|
||||
{
|
||||
version: item.version,
|
||||
zone_id: zoneSource.zone_id,
|
||||
consulted_public_version:
|
||||
zoneSource.consulted_public_version,
|
||||
confirm: true,
|
||||
},
|
||||
)
|
||||
}
|
||||
>
|
||||
Confirmar referência neste dossier
|
||||
</button>
|
||||
)}
|
||||
{sectorSource && (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user