feat: add update mii button
Some checks failed
Build and Publish Docker Image / Build and Publish (amd64) (push) Has been cancelled
Build and Publish Docker Image / Build and Publish (arm64) (push) Has been cancelled

This commit is contained in:
mrjvs
2026-08-12 18:08:49 +02:00
parent 82f952608c
commit 42782367ba
2 changed files with 24 additions and 4 deletions

View File

@@ -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

View File

@@ -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);
}
}
</script>
<template>
@@ -89,6 +104,11 @@ async function unlinkDiscord() {
>
Link discord
</button>
<button
@click="updateMii()"
>
Update Mii
</button>
<button
:style="{ color: 'red' }"
@click="deleteAccount()"