Skip to content

Commit 45af66c

Browse files
Added the user_id explicitly to get the completed task
1 parent 99094c1 commit 45af66c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/backend/common/database/cosmosdb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ async def get_all_plans_by_team_id(self, team_id: str) -> List[Plan]:
235235
return await self.query_items(query, parameters, Plan)
236236

237237

238-
async def get_all_plans_by_team_id_status(self, team_id: str, status: str) -> List[Plan]:
238+
async def get_all_plans_by_team_id_status(self, user_id: str,team_id: str, status: str) -> List[Plan]:
239239
"""Retrieve all plans for a specific team."""
240240
query = "SELECT * FROM c WHERE c.team_id=@team_id AND c.data_type=@data_type and c.user_id=@user_id and c.overall_status=@status ORDER BY c._ts DESC"
241241
parameters = [
242-
{"name": "@user_id", "value": self.user_id},
242+
{"name": "@user_id", "value": user_id},
243243
{"name": "@team_id", "value": team_id},
244244
{"name": "@data_type", "value": DataType.plan},
245245
{"name": "@status", "value": status},

src/backend/common/database/database_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def get_all_plans_by_team_id(self, team_id: str) -> List[Plan]:
9393

9494
@abstractmethod
9595
async def get_all_plans_by_team_id_status(
96-
self, team_id: str, status: str
96+
self, user_id:str, team_id: str, status: str
9797
) -> List[Plan]:
9898
"""Retrieve all plans for a specific team."""
9999
pass

src/backend/v3/api/router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ async def get_plans(request: Request):
12141214
return []
12151215

12161216
all_plans = await memory_store.get_all_plans_by_team_id_status(
1217-
team_id=current_team.team_id, status=PlanStatus.completed
1217+
user_id=user_id, team_id=current_team.team_id, status=PlanStatus.completed
12181218
)
12191219

12201220
return all_plans

0 commit comments

Comments
 (0)