From c03e710fef734e5c817ea1ed6023092475c307a6 Mon Sep 17 00:00:00 2001 From: mehm8128 Date: Wed, 12 Jun 2024 14:04:15 +0900 Subject: [PATCH] =?UTF-8?q?uid=E3=81=8B=E3=82=89=E5=8F=96=E5=BE=97&Promise?= =?UTF-8?q?.all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/UserPage.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/pages/UserPage.vue b/src/pages/UserPage.vue index be1de0d..ca12bef 100644 --- a/src/pages/UserPage.vue +++ b/src/pages/UserPage.vue @@ -9,11 +9,21 @@ import UserDetailContainer from '/@/components/User/UserDetailContainer.vue' import apis from '/@/lib/apis' import useParam from '/@/lib/param' -const userId = useParam('userId') -const userDetail = (await apis.getUser(userId.value)).data -const userProjects = (await apis.getUserProjects(userId.value)).data -const userContests = (await apis.getUserContests(userId.value)).data -const userGroups = (await apis.getUserGroups(userId.value)).data +const userUId = useParam('userId') +// uuid +const userId = (await apis.getUsers(undefined, userUId.value)).data[0]?.id ?? '' + +const [ + { data: userDetail }, + { data: userProjects }, + { data: userContests }, + { data: userGroups } +] = await Promise.all([ + apis.getUser(userId), + apis.getUserProjects(userId), + apis.getUserContests(userId), + apis.getUserGroups(userId) +]) // const userEvents = (await apis.getUserEvents(userId.value)).data