-
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
fix #1611
base: develop
Are you sure you want to change the base?
fix #1611
Changes from 1 commit
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 |
---|---|---|
|
@@ -10,8 +10,21 @@ | |
*/ | ||
|
||
export const getLocalityCode = (locality, tenantId) => { | ||
if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; | ||
else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; | ||
const isMultiRootTenant = Digit.Utils.getMultiRootTenant(); // Replace with your actual condition | ||
|
||
if (typeof locality === "string") { | ||
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. dont change in common method, it will be used outside pgr |
||
return locality.includes("_") | ||
? locality | ||
: isMultiRootTenant | ||
? `ADMIN_${locality}` | ||
:`${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; | ||
} else if (locality.code) { | ||
return locality.code.includes("_") | ||
? locality.code | ||
: isMultiRootTenant | ||
? `ADMIN_${locality.code}` | ||
:`${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; | ||
} | ||
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. 🧹 Nitpick (assertive) Update function signature and add JSDoc. The function now depends on /**
* Get the locality code based on the input and tenant type.
* @param {string|Object} locality - The locality string or object with a code property.
* @param {string} tenantId - The tenant ID.
* @returns {string} The formatted locality code.
*/
export const getLocalityCode = (locality, tenantId) => {
// ... existing implementation
};
jagankumar-egov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
||
export const getRevenueLocalityCode = (locality, tenantId) => { | ||
|
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.
Replace TODO comment with actual implementation.
The comment suggests replacing
Digit.Utils.getMultiRootTenant()
with the actual condition. Ensure this is implemented correctly.Also, consider adding error handling for this call: