mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-23 00:57:21 -05:00
feat: add update mii button
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()"
|
||||
|
||||
Reference in New Issue
Block a user