Skip to content
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

Siddev3 #427

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Siddev3 #427

wants to merge 3 commits into from

Conversation

Siddarthapogula
Copy link
Collaborator

No description provided.

Comment on lines +14 to +15
const dbAcl = acls?.[0];
if (!dbAcl) return res.status(404).send(`No ACL with id [${id}].`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const dbAcl = acls?.[0];
if (!dbAcl) return res.status(404).send(`No ACL with id [${id}].`);
if (!acls?.[0]) return res.status(404).send(`No ACL with id [${id}].`);

const id = req.query.id as string;
if (!id) return res.status(422).send(`Missing param id.`);
const acls: any[] = await executeAndEndSet500OnError(
`SELECT * FROM AccessControlList where id = ?`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't select *, select id is sufficient

if (!dbAcl) return res.status(404).send(`No ACL with id [${id}].`);

const members: ACLMembership[] = await executeAndEndSet500OnError(
'SELECT * FROM ACLMembership WHERE parentACLId = ?',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'SELECT * FROM ACLMembership WHERE parentACLId = ?',
'SELECT memberUserId FROM ACLMembership WHERE parentACLId = ? AND memberUserId IS NOT NULL',

[directMembers],
res
);
res
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to also return the members whose entry is not found the database. Return empty string from this API.
And on the frontend show Unknown (in italics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants