This repository was archived by the owner on Jun 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import datetime
2- from typing import Optional , Tuple
2+ from typing import Optional , Tuple , List
33
44from codegate .db .connection import DbReader , DbRecorder
5- from codegate .db .models import Session , Workspace
5+ from codegate .db .models import Session , Workspace , WorkspaceActive , ActiveWorkspace
66
77
88class WorkspaceCrud :
@@ -21,12 +21,18 @@ async def add_workspace(self, new_workspace_name: str) -> bool:
2121 workspace_created = await db_recorder .add_workspace (new_workspace_name )
2222 return bool (workspace_created )
2323
24- async def get_workspaces (self ):
24+ async def get_workspaces (self )-> List [ WorkspaceActive ] :
2525 """
2626 Get all workspaces
2727 """
2828 return await self ._db_reader .get_workspaces ()
2929
30+ async def get_active_workspace (self ) -> Optional [ActiveWorkspace ]:
31+ """
32+ Get the active workspace
33+ """
34+ return await self ._db_reader .get_active_workspace ()
35+
3036 async def _is_workspace_active_or_not_exist (
3137 self , workspace_name : str
3238 ) -> Tuple [bool , Optional [Session ], Optional [Workspace ]]:
You can’t perform that action at this time.
0 commit comments