mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 14:28:20 +00:00
feat: more fixes
This commit is contained in:
@@ -224,11 +224,6 @@ export const projectMembershipDALFactory = (db: TDbClient) => {
|
|||||||
.join(TableName.Users, `${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)
|
.join(TableName.Users, `${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)
|
||||||
.where(`${TableName.Users}.id`, userId)
|
.where(`${TableName.Users}.id`, userId)
|
||||||
.where(`${TableName.Project}.orgId`, orgId)
|
.where(`${TableName.Project}.orgId`, orgId)
|
||||||
.join<TUserEncryptionKeys>(
|
|
||||||
TableName.UserEncryptionKey,
|
|
||||||
`${TableName.UserEncryptionKey}.userId`,
|
|
||||||
`${TableName.Users}.id`
|
|
||||||
)
|
|
||||||
.join(TableName.MembershipRole, `${TableName.MembershipRole}.membershipId`, `${TableName.Membership}.id`)
|
.join(TableName.MembershipRole, `${TableName.MembershipRole}.membershipId`, `${TableName.Membership}.id`)
|
||||||
.leftJoin(TableName.Role, `${TableName.MembershipRole}.customRoleId`, `${TableName.Role}.id`)
|
.leftJoin(TableName.Role, `${TableName.MembershipRole}.customRoleId`, `${TableName.Role}.id`)
|
||||||
.select(
|
.select(
|
||||||
@@ -236,7 +231,6 @@ export const projectMembershipDALFactory = (db: TDbClient) => {
|
|||||||
db.ref("isGhost").withSchema(TableName.Users),
|
db.ref("isGhost").withSchema(TableName.Users),
|
||||||
db.ref("username").withSchema(TableName.Users),
|
db.ref("username").withSchema(TableName.Users),
|
||||||
db.ref("email").withSchema(TableName.Users),
|
db.ref("email").withSchema(TableName.Users),
|
||||||
db.ref("publicKey").withSchema(TableName.UserEncryptionKey),
|
|
||||||
db.ref("firstName").withSchema(TableName.Users),
|
db.ref("firstName").withSchema(TableName.Users),
|
||||||
db.ref("lastName").withSchema(TableName.Users),
|
db.ref("lastName").withSchema(TableName.Users),
|
||||||
db.ref("id").withSchema(TableName.Users).as("userId"),
|
db.ref("id").withSchema(TableName.Users).as("userId"),
|
||||||
@@ -258,22 +252,11 @@ export const projectMembershipDALFactory = (db: TDbClient) => {
|
|||||||
|
|
||||||
const members = sqlNestRelationships({
|
const members = sqlNestRelationships({
|
||||||
data: docs,
|
data: docs,
|
||||||
parentMapper: ({
|
parentMapper: ({ email, firstName, username, lastName, isGhost, id, projectId, projectName, projectType }) => ({
|
||||||
email,
|
|
||||||
firstName,
|
|
||||||
username,
|
|
||||||
lastName,
|
|
||||||
publicKey,
|
|
||||||
isGhost,
|
|
||||||
id,
|
|
||||||
projectId,
|
|
||||||
projectName,
|
|
||||||
projectType
|
|
||||||
}) => ({
|
|
||||||
id,
|
id,
|
||||||
userId,
|
userId,
|
||||||
projectId,
|
projectId,
|
||||||
user: { email, username, firstName, lastName, id: userId, publicKey, isGhost },
|
user: { email, username, firstName, lastName, id: userId, isGhost, publicKey: "" },
|
||||||
project: {
|
project: {
|
||||||
id: projectId,
|
id: projectId,
|
||||||
name: projectName,
|
name: projectName,
|
||||||
|
|||||||
+4
-4
@@ -121,14 +121,14 @@ export const AddMemberModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
.map((member) => {
|
.map((member) => {
|
||||||
if (!member) return null;
|
if (!member) return null;
|
||||||
|
|
||||||
if (member.user.email) {
|
|
||||||
return member.user.email;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (member.user.username) {
|
if (member.user.username) {
|
||||||
return member.user.username;
|
return member.user.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (member.user.email) {
|
||||||
|
return member.user.email;
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
})
|
})
|
||||||
.filter(Boolean) as string[];
|
.filter(Boolean) as string[];
|
||||||
|
|||||||
Reference in New Issue
Block a user