Skip to content

Commit

Permalink
Bugfix for checking for non-admin users in create project controller (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Apr 5, 2024
1 parent 1df9821 commit 49f30e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/controllers/project/create-project-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export const createProjectController = async (req: IGetUserAuthInfoRequest, res:
const usersWithRoles = await db.manyOrNone(
"SELECT users.role, users.id FROM jtl.users users WHERE users.id IN ($1:list)",
[projectMembers])
if (usersWithRoles && usersWithRoles.length > 0) {
const nonAdminUsers = usersWithRoles.filter(user => user.role !== AllowedRoles.Admin)
const nonAdminUsers = usersWithRoles.filter(user => user.role !== AllowedRoles.Admin)
if (nonAdminUsers && nonAdminUsers.length > 0) {
const columnSet = new pg.helpers.ColumnSet([
{ name: "project_id", prop: "projectId" },
{ name: "user_id", prop: "userId" }],
Expand Down

0 comments on commit 49f30e8

Please sign in to comment.