Working on project front side.

This commit is contained in:
charles-gauthereau
2024-12-01 11:11:27 +01:00
parent 42314a9b69
commit b955d11613
19 changed files with 136 additions and 32 deletions
+12 -3
View File
@@ -1,6 +1,6 @@
import {prisma} from "@/prisma";
import {NextRequest, NextResponse} from "next/server";
import {Agent, Database, Dbms} from "@prisma/client";
import {NextResponse} from "next/server";
import {Dbms} from "@prisma/client";
import {getFileUrlPresignedLocal} from "@/features/upload/private/upload.action";
import {handleDatabases} from "./helpers";
@@ -30,7 +30,7 @@ export async function POST(
try {
const agentId = (await params).agentId
const body: Body = await request.json();
const lastContact = new Date()
const lastContact = new Date();
const agent = await prisma.agent.findFirst({
where: {
@@ -42,6 +42,15 @@ export async function POST(
}
const databasesResponse = await handleDatabases(body, agent, lastContact)
await prisma.agent.update({
where:{
id: agentId,
},
data:{
lastContact: lastContact,
}
})
const response = {
agent: {
id: agentId,