fix: agent_card PrismaClient import and schema capabilities
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user