-
Notifications
You must be signed in to change notification settings - Fork 51
PM-973 - fix checkIsUserInvitedToProject #1636
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 |
---|---|---|
|
@@ -233,13 +233,13 @@ export const checkAdminOrCopilot = (token, project) => { | |
return isAdmin || (isCopilot && canManageProject) | ||
} | ||
|
||
export const checkIsUserInvited = (token, project) => { | ||
export const checkIsUserInvitedToProject = (token, project) => { | ||
if (!token) { | ||
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. Consider returning a specific value (e.g., |
||
return | ||
} | ||
|
||
const tokenData = decodeToken(token) | ||
return project && !_.isEmpty(project) && _.find(project.invites, { userId: tokenData.userId }) | ||
return project && !_.isEmpty(project) && (_.find(project.invites, d => d.userId === tokenData.userId || d.email === tokenData.email)) | ||
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. The condition now checks for both |
||
} | ||
|
||
/** | ||
|
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.
The import statement has been updated to use
checkIsUserInvitedToProject
. Ensure that this function is correctly defined and exported in../../util/tc
and that all references tocheckIsUserInvited
in this file and others are updated accordingly.