chore: return username in user response

This commit is contained in:
Steven
2023-12-23 19:23:39 +08:00
parent b8eaf1d57e
commit 8e325f9986
18 changed files with 333 additions and 348 deletions

View File

@ -1,3 +1,4 @@
import { Button } from "@mui/joy";
import { isEqual } from "lodash-es";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
@ -110,8 +111,8 @@ const UpdateAccountDialog: React.FC<Props> = ({ destroy }: Props) => {
}
await userStore.updateUser(
UserPb.fromPartial({
name: `${UserNamePrefix}${state.username}`,
id: currentUser.id,
name: currentUser.name,
username: state.username,
nickname: state.nickname,
email: state.email,
avatarUrl: state.avatarUrl,
@ -167,13 +168,13 @@ const UpdateAccountDialog: React.FC<Props> = ({ destroy }: Props) => {
<span className="text-sm text-gray-400 ml-1">{t("setting.account-section.email-note")}</span>
</p>
<input type="text" className="input-text" value={state.email} onChange={handleEmailChanged} />
<div className="pt-2 w-full flex flex-row justify-end items-center space-x-2">
<span className="btn-text" onClick={handleCloseBtnClick}>
<div className="w-full flex flex-row justify-end items-center pt-4 space-x-2">
<Button color="neutral" variant="plain" onClick={handleCloseBtnClick}>
{t("common.cancel")}
</span>
<span className="btn-primary" onClick={handleSaveBtnClick}>
</Button>
<Button color="primary" onClick={handleSaveBtnClick}>
{t("common.save")}
</span>
</Button>
</div>
</div>
</>