-
Notifications
You must be signed in to change notification settings - Fork 155
feat(notifications): require users and groups to be of the form namespace/name #1352
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
Conversation
@@ -30,31 +30,23 @@ export async function createNotification( | |||
let isUser = false; | |||
|
|||
// validate users | |||
if (Array.isArray(req.targetGroups) && req.targetGroups.length > 0) { | |||
if ( | |||
req.targetGroups && |
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.
I think we do not need this check since it is included in the Array.isArray()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
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.
Or is it just to make the TypeScript happy?
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.
exactly. unfortunately, the compiler understands the 'undefined' check but not the 'isArray' check.
} | ||
|
||
// validate groups | ||
if (Array.isArray(req.targetUsers) && req.targetUsers.length > 0) { | ||
if ( | ||
req.targetUsers && |
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.
likewise
…pace/name FLPATH-1087 https://issues.redhat.com/browse/FLPATH-1087 Signed-off-by: Yaron Dayagi <[email protected]>
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mareklibra The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
FLPATH-1087
https://issues.redhat.com/browse/FLPATH-1087