-
Notifications
You must be signed in to change notification settings - Fork 19
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
not selected added in single value list #1824
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 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -276,6 +276,9 @@ const UpdateChecklist = () => { | |||||||||||||
return upperCaseString.replace(/ /g, '_'); | ||||||||||||||
}); | ||||||||||||||
} | ||||||||||||||
if(String(item?.type?.code) === "SingleValueList"){ | ||||||||||||||
labelsArray.push("NOT_SELECTED"); | ||||||||||||||
} | ||||||||||||||
Comment on lines
+279
to
+281
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. 🛠️ Refactor suggestion Improve error handling specificity The error handling could be more specific about what went wrong during the update process. Consider enhancing the error handling: } catch (error) {
- setShowToast({ label: "CHECKLIST_UPDATE_FAILED", isError: "true" });
+ const errorMessage = error.response?.data?.message || "CHECKLIST_UPDATE_FAILED";
+ setShowToast({
+ label: errorMessage,
+ isError: "true",
+ details: error.message
+ });
// console.error("Error creating checklist:", error);
} Also applies to: 279-281 🧹 Nitpick (assertive) Improve string comparison robustness The string comparison for question type could be more resilient to edge cases. Consider this improvement: -if(String(item?.type?.code) === "SingleValueList"){
+if(String(item?.type?.code)?.toUpperCase() === "SINGLEVALUELIST"){ This change makes the comparison case-insensitive and more maintainable. 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
const questionObject = { | ||||||||||||||
id: item.id, | ||||||||||||||
|
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.
🧹 Nitpick (assertive)
Document the active-only filtering behavior.
Consider adding a code comment to document that this configuration only returns active checklist templates. This helps other developers understand the filtering behavior.
schemaCode: `HCM-ADMIN-CONSOLE.ChecklistTemplates`, +// Only fetch active checklist templates isActive: true, filters : {},
📝 Committable suggestion