Skip to content

Commit 588b423

Browse files
committed
Refactor current team methods to use add/update item
Replaced direct upsert_item calls with add_item and update_item in set_current_team and update_current_team methods for improved abstraction and consistency.
1 parent b229c19 commit 588b423

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/backend/common/database/cosmosdb.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,10 @@ async def get_current_team(self, user_id: str, team_id: str) -> UserCurrentTeam:
454454
async def set_current_team(self, current_team: UserCurrentTeam) -> None:
455455
"""Set the current team for a user."""
456456
await self._ensure_initialized()
457+
await self.add_item(current_team)
457458

458459

459-
await self.container.upsert_item(current_team.dict())
460460
async def update_current_team(self, current_team: UserCurrentTeam) -> None:
461461
"""Update the current team for a user."""
462462
await self._ensure_initialized()
463-
464-
465-
await self.container.upsert_item(current_team.dict())
463+
await self.update_item(current_team)

0 commit comments

Comments
 (0)