scope niceid to the orgId

This commit is contained in:
Pallavi Kumari
2025-11-06 23:50:57 +05:30
parent abc5f8ec68
commit 0af51cebbe
2 changed files with 19 additions and 4 deletions

View File

@@ -242,7 +242,12 @@ async function updateHttpResource(
const [existingResource] = await db
.select()
.from(resources)
.where(eq(resources.niceId, updateData.niceId));
.where(
and(
eq(resources.niceId, updateData.niceId),
eq(resources.orgId, resource.orgId)
)
);
if (
existingResource &&
@@ -387,7 +392,12 @@ async function updateRawResource(
const [existingResource] = await db
.select()
.from(resources)
.where(eq(resources.niceId, updateData.niceId));
.where(
and(
eq(resources.niceId, updateData.niceId),
eq(resources.orgId, resource.orgId)
)
);
if (
existingResource &&