Requested changes

This commit is contained in:
Daniel Hougaard
2024-02-22 05:00:26 +01:00
parent 419916ee0c
commit a6e263eded
21 changed files with 53 additions and 41 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ export const orgDALFactory = (db: TDbClient) => {
db.ref("id").withSchema(TableName.Users).as("userId"),
db.ref("publicKey").withSchema(TableName.UserEncryptionKey)
)
.where({ ghost: false }); // MAKE SURE USER IS NOT A GHOST USER
.where({ isGhost: false }); // MAKE SURE USER IS NOT A GHOST USER
return members.map(({ email, firstName, lastName, userId, publicKey, ...data }) => ({
...data,
user: { email, firstName, lastName, id: userId, publicKey }
@@ -136,7 +136,7 @@ export const orgDALFactory = (db: TDbClient) => {
db.ref("id").withSchema(TableName.Users).as("userId"),
db.ref("publicKey").withSchema(TableName.UserEncryptionKey)
)
.where({ ghost: true });
.where({ isGhost: true });
return member;
} catch (error) {
return null;
@@ -150,7 +150,7 @@ export const orgDALFactory = (db: TDbClient) => {
.join(TableName.Users, `${TableName.OrgMembership}.userId`, `${TableName.Users}.id`)
.leftJoin(TableName.UserEncryptionKey, `${TableName.UserEncryptionKey}.userId`, `${TableName.Users}.id`)
.select(db.ref("id").withSchema(TableName.Users).as("userId"))
.where({ ghost: true });
.where({ isGhost: true });
return !!member;
} catch (error) {
return false;
+2 -2
View File
@@ -138,7 +138,7 @@ export const orgServiceFactory = ({
const user = await userDAL.create(
{
ghost: true,
isGhost: true,
authMethods: [AuthMethod.EMAIL],
email,
isAccepted: true
@@ -401,7 +401,7 @@ export const orgServiceFactory = ({
email: inviteeEmail,
isAccepted: false,
authMethods: [AuthMethod.EMAIL],
ghost: false
isGhost: false
},
tx
);