Skip to content

Commit

Permalink
♻️ Rename setUserInputs to updateUserInputs in UserStore
Browse files Browse the repository at this point in the history
  • Loading branch information
usagizmo committed Apr 28, 2024
1 parent 6d83ba9 commit b98bc5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/lib/features/user/userStore.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export class UserStore {
}

/**
* Set the user inputs
* Update the user inputs
* @param userInputs - The user inputs
*/
setUserInputs(userInputs: Partial<UserInputs>): void {
updateUserInputs(userInputs: Partial<UserInputs>): void {
this.#userInputs = { ...this.#userInputs, ...userInputs };
}

Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/routes/admin/(isNotLoggedIn)/UserInputs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
label="Display Name"
type="text"
value={userStore.userInputs.displayName}
oninput={(event) => userStore.setUserInputs({ displayName: (event.target as HTMLInputElement).value })}
oninput={(event) => userStore.updateUserInputs({ displayName: (event.target as HTMLInputElement).value })}
error={{ required: 'Display Name is required.' }}
/>
</div>
Expand All @@ -25,14 +25,14 @@
label="Email"
type="email"
value={userStore.userInputs.email}
oninput={(event) => userStore.setUserInputs({ email: (event.target as HTMLInputElement).value })}
oninput={(event) => userStore.updateUserInputs({ email: (event.target as HTMLInputElement).value })}
error={{ required: 'E-mail is required.' }}
/>
<Input
label="Password"
type="password"
value={userStore.userInputs.password}
oninput={(event) => userStore.setUserInputs({ password: (event.target as HTMLInputElement).value })}
oninput={(event) => userStore.updateUserInputs({ password: (event.target as HTMLInputElement).value })}
error={{ required: 'Password is required.' }}
/>
</div>

0 comments on commit b98bc5b

Please sign in to comment.