fix: agent_card PrismaClient import and schema capabilities
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s

This commit is contained in:
OG T
2026-06-08 13:38:49 +08:00
parent f671deaaa8
commit fb54b2c43c
2 changed files with 6 additions and 5 deletions

View File

@@ -122,6 +122,7 @@ model AgentProfile {
type String // BUILDER or SCOUT
wallet_address String?
status String // WHITELISTED, BANNED, PENDING
capabilities Json?
created_at DateTime @default(now())
updated_at DateTime @updatedAt

View File

@@ -1,9 +1,7 @@
import { NextResponse } from "next/server";
import { PrismaClient } from "@prisma/client";
import { prisma } from "@/lib/prisma";
import { RegisterAgentCardRequestSchema, RegisterAgentCardResponseSchema } from "@agent-bounty/contracts";
const prisma = new PrismaClient();
export async function POST(req: Request) {
try {
const json = await req.json();
@@ -21,12 +19,14 @@ export async function POST(req: Request) {
where: { agent_id: card.agent_id },
update: {
capabilities: JSON.parse(JSON.stringify(card)),
x402_wallet_address: card.x402_wallet_address,
wallet_address: card.x402_wallet_address,
},
create: {
agent_id: card.agent_id,
type: "BUILDER", // Default type
status: "WHITELISTED", // Default status
capabilities: JSON.parse(JSON.stringify(card)),
x402_wallet_address: card.x402_wallet_address,
wallet_address: card.x402_wallet_address,
}
});