File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
import datetime
2
- from typing import Optional , Tuple
2
+ from typing import Optional , Tuple , List
3
3
4
4
from codegate .db .connection import DbReader , DbRecorder
5
- from codegate .db .models import Session , Workspace
5
+ from codegate .db .models import Session , Workspace , WorkspaceActive , ActiveWorkspace
6
6
7
7
8
8
class WorkspaceCrud :
@@ -21,12 +21,18 @@ async def add_workspace(self, new_workspace_name: str) -> bool:
21
21
workspace_created = await db_recorder .add_workspace (new_workspace_name )
22
22
return bool (workspace_created )
23
23
24
- async def get_workspaces (self ):
24
+ async def get_workspaces (self )-> List [ WorkspaceActive ] :
25
25
"""
26
26
Get all workspaces
27
27
"""
28
28
return await self ._db_reader .get_workspaces ()
29
29
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
+
30
36
async def _is_workspace_active_or_not_exist (
31
37
self , workspace_name : str
32
38
) -> Tuple [bool , Optional [Session ], Optional [Workspace ]]:
You can’t perform that action at this time.
0 commit comments