Skip to content

Commit

Permalink
Fix existing agent check
Browse files Browse the repository at this point in the history
  • Loading branch information
parzival418 committed Aug 21, 2024
1 parent a6e62ff commit 8992291
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export default defineNitroPlugin(async nitroApp => {

agentId = agentId || runtimeConfig.agentId

const existingAgent = await prisma.agents.findUnique({
where: {
id: agentId || '',
},
})
const existingAgent = agentId
? await prisma.agents.findUnique({
where: {
id: agentId,
},
})
: null

if (!existingAgent) {
const agent = await prisma.agents.create({
Expand Down

0 comments on commit 8992291

Please sign in to comment.