From 498e2ad6cc38963dff8f3011a0cc5272ff97f2b7 Mon Sep 17 00:00:00 2001 From: Shotaro Nakamura <79000684+nakasyou@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:15:59 +0900 Subject: [PATCH] Update ManageSchools.tsx --- islands/admin/components/ManageSchools.tsx | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/islands/admin/components/ManageSchools.tsx b/islands/admin/components/ManageSchools.tsx index 4df66ea..3ddb088 100644 --- a/islands/admin/components/ManageSchools.tsx +++ b/islands/admin/components/ManageSchools.tsx @@ -14,19 +14,20 @@ export default (props: Props) => { schoolName: string }[]>([]) const syncSchoolsData = async () => { - let result - try { - result = await ky.post('/admin/api', { - json: { - type: 'get_schools_data', - password: props.password - } - }).json() - } catch (error) { - alert('エラーが発生しました。パスワードが間違っている可能性があります。') - alert(error) - throw error - } + let result + try { + result = await ky.post('/admin/api', { + json: { + type: 'get_schools_data', + password: props.password + } + }).json() + } catch (error) { + alert('エラーが発生しました。パスワードが間違っている可能性があります。') + alert(error) + throw error + } + alert(JSON.stringify(result)) setSchoolsData(result.schoolsData) } return