feat: more fixes

This commit is contained in:
=
2025-10-08 00:52:20 +05:30
parent e5195403e9
commit f9472d753d
2 changed files with 6 additions and 23 deletions

View File

@@ -224,11 +224,6 @@ export const projectMembershipDALFactory = (db: TDbClient) => {
.join(TableName.Users, `${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)
.where(`${TableName.Users}.id`, userId)
.where(`${TableName.Project}.orgId`, orgId)
.join<TUserEncryptionKeys>(
TableName.UserEncryptionKey,
`${TableName.UserEncryptionKey}.userId`,
`${TableName.Users}.id`
)
.join(TableName.MembershipRole, `${TableName.MembershipRole}.membershipId`, `${TableName.Membership}.id`)
.leftJoin(TableName.Role, `${TableName.MembershipRole}.customRoleId`, `${TableName.Role}.id`)
.select(
@@ -236,7 +231,6 @@ export const projectMembershipDALFactory = (db: TDbClient) => {
db.ref("isGhost").withSchema(TableName.Users),
db.ref("username").withSchema(TableName.Users),
db.ref("email").withSchema(TableName.Users),
db.ref("publicKey").withSchema(TableName.UserEncryptionKey),
db.ref("firstName").withSchema(TableName.Users),
db.ref("lastName").withSchema(TableName.Users),
db.ref("id").withSchema(TableName.Users).as("userId"),
@@ -258,22 +252,11 @@ export const projectMembershipDALFactory = (db: TDbClient) => {
const members = sqlNestRelationships({
data: docs,
parentMapper: ({
email,
firstName,
username,
lastName,
publicKey,
isGhost,
id,
projectId,
projectName,
projectType
}) => ({
parentMapper: ({ email, firstName, username, lastName, isGhost, id, projectId, projectName, projectType }) => ({
id,
userId,
projectId,
user: { email, username, firstName, lastName, id: userId, publicKey, isGhost },
user: { email, username, firstName, lastName, id: userId, isGhost, publicKey: "" },
project: {
id: projectId,
name: projectName,

View File

@@ -121,14 +121,14 @@ export const AddMemberModal = ({ popUp, handlePopUpToggle }: Props) => {
.map((member) => {
if (!member) return null;
if (member.user.email) {
return member.user.email;
}
if (member.user.username) {
return member.user.username;
}
if (member.user.email) {
return member.user.email;
}
return null;
})
.filter(Boolean) as string[];