mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
chore: added user role for projects (#1190)
This commit is contained in:
committed by
GitHub
parent
3d9341366f
commit
dcf3f3b344
@@ -44,6 +44,7 @@ class ProjectType:
|
||||
total_members: int
|
||||
total_issues: int
|
||||
total_active_issues: int
|
||||
role: int
|
||||
|
||||
@strawberry.field
|
||||
def workspace(self) -> int:
|
||||
@@ -73,6 +74,16 @@ class ProjectType:
|
||||
).count()
|
||||
)()
|
||||
return projects
|
||||
|
||||
@strawberry.field
|
||||
async def role(self, info: strawberry.Info) -> int:
|
||||
project_member = await sync_to_async(
|
||||
lambda: ProjectMember.objects.get(
|
||||
project_id=self.id, is_active=True, member_id=info.context.user.id
|
||||
)
|
||||
)()
|
||||
return project_member.role
|
||||
|
||||
|
||||
@strawberry.field
|
||||
async def total_issues(self, info: Info) -> int:
|
||||
|
||||
Reference in New Issue
Block a user