fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { inputText } from '../../lib/input-text.ts';
|
||||
import { Link, router, useForm } from '@inertiajs/react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Frame, card, button } from '@/pages/investment/shared';
|
||||
@@ -127,7 +128,7 @@ export default function Edit({
|
||||
setPreview(null);
|
||||
setSaved(false);
|
||||
};
|
||||
const value = (key: string) => String(form.data.draft[key] ?? '');
|
||||
const value = (key: string) => inputText(form.data.draft[key] ?? '');
|
||||
const select = (key: string, label: string, choices: Choice[]) => (
|
||||
<Field label={label}>
|
||||
<select
|
||||
@@ -270,9 +271,8 @@ export default function Edit({
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
setPreview(null);
|
||||
record
|
||||
? form.put(`/management/concursos/${record.id}`)
|
||||
: form.post('/management/concursos');
|
||||
if (record) form.put(`/management/concursos/${record.id}`);
|
||||
else form.post('/management/concursos');
|
||||
}}
|
||||
>
|
||||
<section className={`${card} grid gap-3 md:grid-cols-2`}>
|
||||
@@ -781,7 +781,7 @@ export default function Edit({
|
||||
</h3>
|
||||
<p>
|
||||
Motivo público:{' '}
|
||||
{String(preview.payload.public_reason)}
|
||||
{inputText(preview.payload.public_reason)}
|
||||
</p>
|
||||
<NoticeContent p={preview.payload} />
|
||||
<button
|
||||
@@ -792,7 +792,7 @@ export default function Edit({
|
||||
{
|
||||
act: preview.act,
|
||||
hash: preview.hash,
|
||||
reason: String(
|
||||
reason: inputText(
|
||||
preview.payload.public_reason,
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user