From 42782367baea6cc9959383d9d5ffdb1df763a023 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Wed, 12 Aug 2026 18:08:49 +0200 Subject: [PATCH] feat: add update mii button --- README.md | 6 +++--- src/pages/account/index.vue | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4eda61d..e823706 100644 --- a/README.md +++ b/README.md @@ -106,13 +106,13 @@ Miscellanous tasks: - [x] Login/logout - [x] Register - [x] Discourse SSO - - [ ] HCaptcha + - [x] HCaptcha - [x] RSS feed - [ ] Stripe checkout - [ ] Stripe donation progress - [ ] Stripe webhooks (+ mailing) - - [ ] Forgot password flow + - [x] Forgot password flow - [x] Delete account - [x] server environment changing - - [ ] Mii edits saving + - [x] Mii edits saving - [x] Auth cookies diff --git a/src/pages/account/index.vue b/src/pages/account/index.vue index 32ac6d7..8b9d00a 100644 --- a/src/pages/account/index.vue +++ b/src/pages/account/index.vue @@ -6,7 +6,7 @@ definePageMeta({ }); const authStore = useAuthStore(); -const { data: profile, refresh } = await useApiFetch('/api/auth/me', { }); +const { data: profile, refresh } = await useApiFetch('/api/auth/me'); async function updateServerEnvironment(env: ApiAccountUpdateRequest['environment']) { try { @@ -59,6 +59,21 @@ async function unlinkDiscord() { alert(err.code); } } + +async function updateMii() { + try { + await apiFetch('/api/account/update', { + method: 'PATCH', + body: { + mii: { name: 'steve', primary: 'Y', data: 'AwAAQMjn20WghCBw2qjhdwOzuI0n2QAAAFhzAHQAZQB2AGUAAAAAAAAAAAAAACoWCgBLBQFoRBgm\r\nNEYUjRIJaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAALaT' } + } satisfies ApiAccountUpdateRequest + }); + await refresh(); + } catch (error: unknown) { + const err = getApiError(error); + alert(err.code); + } +}