mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-29 16:30:24 +08:00
@@ -7,6 +7,7 @@ import React, { useState } from "react";
|
||||
export default function Account() {
|
||||
const { data: session } = useSession();
|
||||
const [username, setUsername] = useState("");
|
||||
|
||||
const updateUser = async (e: React.SyntheticEvent) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
@@ -16,6 +17,7 @@ export default function Account() {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
session.user.name = username;
|
||||
await Router.push("/account");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { getSession } from "next-auth/react";
|
||||
import prisma from "../../lib/prismadb";
|
||||
|
||||
// POST /api/post
|
||||
// Required fields in body: title
|
||||
|
||||
Reference in New Issue
Block a user