Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/routes/dashboard.purchase.confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export const action: ActionFunction = async ({ request }) => {
}

const fieldErrors = {
bankName: validateRequired('Nomor WhatsApp', bankName),
bankAccountNumber: validateRequired('Nama Bank', bankAccountNumber),
bankAccountName: validateRequired('Nomor Rekening', bankAccountName),
bankName: validateRequired('Nama Bank', bankName),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These labels now match the <Field label> props below, but this route still never reads useActionData() or passes fieldErrors back into the form. So a failed POST still will not render these server-side labels anywhere, and there is no focused regression test covering that path. If the intent is a user-visible validation fix, we probably need to plumb fieldErrors into the fields or add an action-level test that proves this branch matters.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These labels are now correct, but action() still only returns fieldErrors; PurchaseConfirm never reads them with useActionData or passes them into the <Field error={...}> props below. That means this fixes the action payload, but not the user-visible validation path in the form itself. If the reported bug was about the message shown after a failed submit, we still need to wire the action data into the fields.

bankAccountNumber: validateRequired('Nomor Rekening', bankAccountNumber),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a regression test around this mapping? Right now there doesn’t seem to be any route/action coverage for dashboard.purchase.confirm, so these duplicated label strings can drift away from the <Field label=...> props again without anything failing. A small action test that posts empty values and asserts the exact fieldErrors messages would lock this fix in.

bankAccountName: validateRequired('Nama Pemilik Rekening', bankAccountName),
amount: validateRequired('Nominal', amount),
}

Expand Down
Loading