-
Notifications
You must be signed in to change notification settings - Fork 506
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
Error message modification in the asset configuration page #8031
Conversation
@AshrafMd-1 is attempting to deploy a commit to the Open Healthcare Network Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@AshrafMd-1 is it good for testing ? |
@nihal467 yes. You can test it |
// Asset IP Conflict | ||
if ( | ||
Array.isArray(error?.non_field_errors) && | ||
error.non_field_errors.length === 1 && | ||
error.non_field_errors[0].includes("IP Address") | ||
) { | ||
const errorMsg = error.non_field_errors[0]; | ||
|
||
const ipAddress = errorMsg.split(" ")[2]; | ||
|
||
const facility = errorMsg | ||
.substring(errorMsg.indexOf("by") + 3) | ||
.split(" ") | ||
.slice(0, -1) | ||
.join(" "); | ||
|
||
notify?.BadRequest({ | ||
errs: `IP Conflict: ${ipAddress} is in-use by '${facility}' asset within the facility`, | ||
}); | ||
|
||
return; | ||
} | ||
|
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.
this logic is specific to asset configuration and not across all requests. Move this to be done in the onResponse
of the request options and dispatch notification there instead of in the shared handleResponse
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.
hey @rithviknishad
i did try but it says
TS2339: Property status does not exist on type RequestResult
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.
res should be deconstructed from the params
onResponse: ({ res }) => { ... }
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist