Skip to content

Commit

Permalink
fix update_agent_version_in_library
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jan 13, 2025
1 parent 700f2a3 commit 85180e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autogpt_platform/backend/backend/server/v2/library/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,15 @@ async def update_agent_version_in_library(
Updates the agent version in the library
"""
try:
await prisma.models.LibraryAgent.prisma().update_many(
library_agent = await prisma.models.LibraryAgent.prisma().find_first_or_raise(
where={
"userId": user_id,
"agentId": agent_id,
"useGraphIsActiveVersion": True,
},
)
await prisma.models.LibraryAgent.prisma().update(
where={"id": library_agent.id},
data=prisma.types.LibraryAgentUpdateInput(
Agent=prisma.types.AgentGraphUpdateOneWithoutRelationsInput(
connect=prisma.types._AgentGraphCompoundPrimaryKey(
Expand Down

0 comments on commit 85180e1

Please sign in to comment.