Skip to content

Commit 999fe70

Browse files
committed
fix: ts error
1 parent 906c729 commit 999fe70

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/global/support/user/type.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { LangEnum } from 'common/i18n/type';
1+
import type { LangEnum } from '../common/i18n/type';
22
import type { TeamPermission } from '../permission/user/controller';
33
import type { UserStatusEnum } from './constant';
44
import type { TeamMemberStatusEnum } from './team/constant';
@@ -28,7 +28,7 @@ export type UserType = {
2828
username: string;
2929
avatar: string; // it should be team member's avatar after 4.8.18
3030
timezone: string;
31-
language: string;
31+
language?: `${LangEnum}`;
3232
promotionRate: UserModelSchema['promotionRate'];
3333
team: TeamTmbItemType;
3434
notificationAccount?: string;

projects/app/src/pages/account/setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Individuation = () => {
1919
const { toast } = useToast();
2020

2121
const { reset } = useForm<UserUpdateParams>({
22-
defaultValues: userInfo as UserType
22+
defaultValues: userInfo!
2323
});
2424

2525
const onclickSave = useCallback(

projects/app/src/types/user.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
22
import type { UserModelSchema } from '@fastgpt/global/support/user/type';
3-
import type { LangEnum } from '@fastgpt/global/common/i18n/type';
3+
import type { UserType } from '@fastgpt/global/support/user/type';
44

55
export interface UserUpdateParams {
66
avatar?: string;
77
timezone?: string;
8-
language?: `${LangEnum}`;
8+
language?: UserType['language'];
99
/** @deprecated */
1010
balance?: number;
1111
}

0 commit comments

Comments
 (0)