mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-06 12:19:50 +00:00
Dont need to check user exists for the whitelist
This commit is contained in:
@@ -1467,17 +1467,6 @@ async function syncWhitelistUsers(
|
|||||||
.where(eq(resourceWhitelist.resourceId, resourceId));
|
.where(eq(resourceWhitelist.resourceId, resourceId));
|
||||||
|
|
||||||
for (const email of whitelistUsers) {
|
for (const email of whitelistUsers) {
|
||||||
const [user] = await trx
|
|
||||||
.select()
|
|
||||||
.from(users)
|
|
||||||
.innerJoin(userOrgs, eq(users.userId, userOrgs.userId))
|
|
||||||
.where(and(eq(users.email, email), eq(userOrgs.orgId, orgId)))
|
|
||||||
.limit(1);
|
|
||||||
|
|
||||||
if (!user) {
|
|
||||||
throw new Error(`User not found: ${email} in org ${orgId}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const existingWhitelistEntry = existingWhitelist.find(
|
const existingWhitelistEntry = existingWhitelist.find(
|
||||||
(w) => w.email === email
|
(w) => w.email === email
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user