feat: add mobile My Work inbox (#115)
This commit is contained in:
1 parent
dce7373845
commit
de2f8d8fcc
7 files changed
+295
-2
No files matched your search
+6
-2
@@ -30,11 +30,15 @@ async def repos() -> list[dict]:
|
||||
|
||||
|
||||
async def issues() -> list[dict]:
|
||||
return await fetch("user/issues?limit=50&type=all")
|
||||
return await fetch(
|
||||
"repos/issues/search?state=open&assigned=true&type=issues&limit=50"
|
||||
)
|
||||
|
||||
|
||||
async def pull_requests() -> list[dict]:
|
||||
return await fetch("user/pulls?limit=50")
|
||||
return await fetch(
|
||||
"repos/issues/search?state=open&assigned=true&type=pulls&limit=50"
|
||||
)
|
||||
|
||||
|
||||
async def activity_events() -> list[dict]:
|
||||
|
||||
+22
@@ -156,6 +156,12 @@ async def context() -> JSONResponse:
|
||||
for assignee in (i.get("assignees") or [])
|
||||
if isinstance(assignee, dict)
|
||||
],
|
||||
repository=(
|
||||
i["repository"].get("full_name", "")
|
||||
if isinstance(i.get("repository"), dict)
|
||||
else ""
|
||||
),
|
||||
updated_at=i.get("updated_at") or "",
|
||||
url=i["html_url"],
|
||||
)
|
||||
for i in (issues_data or [])[:50]
|
||||
@@ -176,6 +182,22 @@ async def context() -> JSONResponse:
|
||||
if isinstance(p.get("user"), dict)
|
||||
else ""
|
||||
),
|
||||
labels=[
|
||||
label.get("name", "")
|
||||
for label in (p.get("labels") or [])
|
||||
if isinstance(label, dict)
|
||||
],
|
||||
assignees=[
|
||||
assignee.get("login", "")
|
||||
for assignee in (p.get("assignees") or [])
|
||||
if isinstance(assignee, dict)
|
||||
],
|
||||
repository=(
|
||||
p["repository"].get("full_name", "")
|
||||
if isinstance(p.get("repository"), dict)
|
||||
else ""
|
||||
),
|
||||
updated_at=p.get("updated_at") or "",
|
||||
url=p["html_url"],
|
||||
)
|
||||
for p in (prs_data or [])[:50]
|
||||
|
||||
@@ -24,6 +24,8 @@ class Issue(BaseModel):
|
||||
state: str
|
||||
labels: list[str] = []
|
||||
assignees: list[str] = []
|
||||
repository: str = ""
|
||||
updated_at: str = ""
|
||||
url: str
|
||||
|
||||
|
||||
@@ -33,6 +35,10 @@ class PullRequest(BaseModel):
|
||||
title: str
|
||||
state: str
|
||||
user: str
|
||||
labels: list[str] = []
|
||||
assignees: list[str] = []
|
||||
repository: str = ""
|
||||
updated_at: str = ""
|
||||
url: str
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user