Skip to content

Commit beecb7c

Browse files
committed
chores: use repo scoped api request ref: #802
1 parent b2575c8 commit beecb7c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

dashboard/src/routes.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ const RepositoryData: RouteDataFunc<
1717
() => params.id,
1818
(id) => client.getRepository({ repositoryId: id }),
1919
)
20-
const [apps] = createResource(repo, async (repo) => {
21-
const allAppsRes = await client.getApplications({
22-
scope: GetApplicationsRequest_Scope.ALL,
23-
})
24-
return allAppsRes.applications.filter((app) => app.repositoryId === repo.id)
25-
})
20+
const [apps] = createResource(
21+
() => params.id,
22+
(id) =>
23+
client
24+
.getApplications({
25+
scope: GetApplicationsRequest_Scope.REPOSITORY,
26+
repositoryId: id,
27+
})
28+
.then((r) => r.applications),
29+
)
2630
const hasPermission = createMemo(
2731
() => (user()?.admin || (user.latest !== undefined && repo()?.ownerIds.includes(user().id))) ?? false,
2832
)

0 commit comments

Comments
 (0)