mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-09-16 04:48:14 -05:00
17 lines
481 B
TypeScript
17 lines
481 B
TypeScript
import { AccountUpdateSchema } from '~~/shared/api-types';
|
|
|
|
export default defineEventHandler(async (event): Promise<void> => {
|
|
const body = await readZodBody(event, AccountUpdateSchema);
|
|
const auth = enforceLoggedIn(event);
|
|
const grpc = useApiGrpcWithToken(event, auth.token);
|
|
|
|
await grpc.updateUserData({
|
|
gender: body.gender,
|
|
birthday: body.birthday,
|
|
region: body.region,
|
|
timezone: body.timezone,
|
|
mii: body.mii,
|
|
serverAccessLevel: body.serverAccessLevel
|
|
});
|
|
});
|