mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: apply soft-delete filters consistently across api/v1 routes
Four missed cases where deleted/archived resources could leak through: - acl.ts: exclude deleted databases from getAccessibleDatabaseIds - databases/route.ts: exclude deleted databases in list endpoint - agents/route.ts: re-apply isArchived guard on final fetch (ACL ids stale) - databases/[id]/status/route.ts: exclude deleted restorations
This commit is contained in:
@@ -53,7 +53,10 @@ export async function getAccessibleDatabaseIds(userId: string): Promise<string[]
|
||||
if (agentIds.length === 0) return [];
|
||||
|
||||
const databases = await db.query.database.findMany({
|
||||
where: inArray(drizzleDb.schemas.database.agentId, agentIds),
|
||||
where: and(
|
||||
inArray(drizzleDb.schemas.database.agentId, agentIds),
|
||||
isNull(drizzleDb.schemas.database.deletedAt)
|
||||
),
|
||||
columns: { id: true },
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user