mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix(api-v1): return 404 for archived agents in resolveAgentAccess
This commit is contained in:
@@ -15,7 +15,13 @@ async function resolveAgentAccess(id: string, userId: string) {
|
||||
if (accessibleAgentIds.includes(id)) return "ok";
|
||||
|
||||
const exists = await db.query.agent.findFirst({
|
||||
where: eq(drizzleDb.schemas.agent.id, id),
|
||||
where: and(
|
||||
eq(drizzleDb.schemas.agent.id, id),
|
||||
or(
|
||||
eq(drizzleDb.schemas.agent.isArchived, false),
|
||||
isNull(drizzleDb.schemas.agent.isArchived)
|
||||
)
|
||||
),
|
||||
columns: { id: true },
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user