create, delete, and update idp org policies

This commit is contained in:
miloschwartz
2025-04-18 15:38:50 -04:00
parent 3bab90891f
commit 99188233db
22 changed files with 1036 additions and 108 deletions

View File

@@ -77,10 +77,13 @@ export async function createIdpOrgPolicy(
const [existing] = await db
.select()
.from(idp)
.leftJoin(idpOrg, eq(idpOrg.orgId, orgId))
.where(and(eq(idp.idpId, idpId), eq(idpOrg.orgId, orgId)));
.leftJoin(
idpOrg,
and(eq(idpOrg.orgId, orgId), eq(idpOrg.idpId, idpId))
)
.where(eq(idp.idpId, idpId));
if (!existing.idp) {
if (!existing?.idp) {
return next(
createHttpError(
HttpCode.BAD_REQUEST,