From 17db285d6ee8fa59d317623e7db0b409d09f90af Mon Sep 17 00:00:00 2001 From: motoki317 Date: Mon, 4 Dec 2023 22:42:41 +0900 Subject: [PATCH] Use repo scoped apps fetch --- dashboard/src/pages/repos/[id].tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/src/pages/repos/[id].tsx b/dashboard/src/pages/repos/[id].tsx index 57dbfd014..4794b7d56 100644 --- a/dashboard/src/pages/repos/[id].tsx +++ b/dashboard/src/pages/repos/[id].tsx @@ -22,10 +22,10 @@ export default () => { ) const [apps] = createResource( () => params.id, - async () => { - const allAppsRes = await client.getApplications({ scope: GetApplicationsRequest_Scope.ALL }) - return repo() ? allAppsRes.applications.filter((app) => app.repositoryId === repo()?.id) : [] - }, + (id) => + client + .getApplications({ scope: GetApplicationsRequest_Scope.REPOSITORY, repositoryId: id }) + .then((r) => r.applications), ) const { Modal: DeleteRepoModal, open: openDeleteRepoModal, close: closeDeleteRepoModal } = useModal()