Skip to content

Commit 5a542c5

Browse files
committed
fix(file-upload): remove control prop and defaultValues
1 parent d782eda commit 5a542c5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/features/account/AccountEmailForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const AccountEmailForm = () => {
7272
<FormField
7373
name="email"
7474
type="email"
75-
control={form.control}
75+
defaultValue={account.data.email}
7676
label={t('account:data.email.label')}
7777
/>
7878
<Flex alignItems="center" gap={4}>

src/features/account/AccountProfileForm.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const AccountProfileForm = () => {
6262
image,
6363
...values
6464
}) => {
65-
let fileUrl = '';
65+
let fileUrl = account.data?.image;
6666
try {
6767
if (image?.file) {
6868
const uploadResponse = await uploadFile.mutateAsync(image?.file);
@@ -85,20 +85,17 @@ export const AccountProfileForm = () => {
8585
<Form {...form} onSubmit={onSubmit}>
8686
<Stack spacing={4}>
8787
<FormField
88-
control={form.control}
8988
name="image"
9089
type="upload"
9190
inputText={t('account:data.avatar.inputText')}
9291
label={t('account:data.avatar.label')}
9392
/>
9493
<FormField
95-
control={form.control}
9694
name="name"
9795
type="text"
9896
label={t('account:data.name.label')}
9997
/>
10098
<FormField
101-
control={form.control}
10299
name="language"
103100
type="select"
104101
options={AVAILABLE_LANGUAGES.map(({ key }) => ({

0 commit comments

Comments
 (0)