feat: org agent management (#259)

* feat: org agent management

* feat: org agent management

* fix: adding migrations for legacy and refactoring.

* fix: refactoring

* fix: delete agent

* fix: refactoring

---------

Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com>
This commit is contained in:
Charles GTE
2026-04-10 18:37:35 +02:00
committed by GitHub
co-authored by charles-gauthereau
parent a620d7a9f7
commit e38519aec2
57 changed files with 13273 additions and 2089 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import {NextResponse} from "next/server";
import {eq} from "drizzle-orm";
import {and, eq} from "drizzle-orm";
import {db} from "@/db";
import * as drizzleDb from "@/db";
import {logger} from "@/lib/logger";
@@ -12,7 +12,7 @@ export function withAgentCheck(handler: Function) {
const agentId = (await context.params).agentId;
const agent = await db.query.agent.findFirst({
where: eq(drizzleDb.schemas.agent.id, agentId),
where: and(eq(drizzleDb.schemas.agent.id, agentId), eq(drizzleDb.schemas.agent.isArchived, false)),
});
if (!agent) {