mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Merge branch 'feature' into feat/refresh
# Conflicts: # app/api/agent/[agentId]/backup/route.ts # app/api/events/route.ts # src/components/wrappers/dashboard/database/backup/actions/backup-actions-form.tsx # src/components/wrappers/dashboard/database/backup/actions/backup-actions.action.ts # src/components/wrappers/dashboard/database/channels-policy/policy-form.tsx # src/lib/tasks/database/index.ts
This commit is contained in:
@@ -6,6 +6,7 @@ import {EDbmsSchema} from "@/db/schema/types";
|
||||
import {eq} from "drizzle-orm";
|
||||
import {isUuidv4} from "@/utils/verify-uuid";
|
||||
import {withUpdatedAt} from "@/db/utils";
|
||||
import {eventEmitter} from "@/features/shared/event";
|
||||
|
||||
export type databaseAgent = {
|
||||
name: string,
|
||||
@@ -25,12 +26,14 @@ export async function POST(
|
||||
) {
|
||||
try {
|
||||
const agentId = (await params).agentId
|
||||
console.log(agentId)
|
||||
const body: Body = await request.json();
|
||||
const lastContact = new Date();
|
||||
let message: string
|
||||
|
||||
if (!isUuidv4(agentId)) {
|
||||
message = "agentId is not a valid uuid"
|
||||
console.error(message)
|
||||
return NextResponse.json(
|
||||
{error: "agentId is not a valid uuid"},
|
||||
{status: 500}
|
||||
@@ -64,6 +67,7 @@ export async function POST(
|
||||
databases: databasesResponse
|
||||
}
|
||||
|
||||
|
||||
return Response.json(response)
|
||||
} catch (error) {
|
||||
console.error('Error in POST handler:', error);
|
||||
|
||||
Reference in New Issue
Block a user