Repository navigation
ezra/325-negating-duplicate-offer-error #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -218,7 +218,7 @@ export default function CreateDonorOfferPage() { | |||||
| onReset={resetUpload} | ||||||
| /> | ||||||
|
|
||||||
| {errors && errors.length > 0 && <ErrorDisplay errors={errors} />} | ||||||
| {errors && errors.length > 0 && !fileErrorMessage && <ErrorDisplay errors={errors} />} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the API returns multiple validation errors (e.g. several invalid CSV rows), In setErrors(errorMessages); // full list
setFileErrorMessage(errorMessages[0]); // first entry onlyA user uploading a CSV with multiple row-level errors would only ever see the first error and would have to fix and re-upload iteratively rather than fixing everything at once. Consider showing
Suggested change
Or alternatively, set |
||||||
|
|
||||||
| {preview && <PreviewTable final={false} data={data} />} | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create/page.tsxThe same logic applies here: when the finalize API returns several row-level CSV errors,
fileErrorMessageonly captures the first, so suppressingErrorDisplaywith!fileErrorMessagehides all subsequent errors from the user. See the comment oncreate/page.tsxfor the full analysis and a suggested remediation.