Skip to content

Commit dd99ed2

Browse files
committed
fix: don't embed password in update if it is empty
1 parent 5d47a9e commit dd99ed2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/app/features/settings/settings.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ export default class SettingsComponent implements OnInit {
6060
submitForm() {
6161
this.isSubmitting.set(true);
6262

63+
const payload = { ...this.settingsForm.value };
64+
if (!payload.password) {
65+
delete payload.password;
66+
}
67+
6368
this.userService
64-
.update(this.settingsForm.value)
69+
.update(payload)
6570
.pipe(takeUntilDestroyed(this.destroyRef))
6671
.subscribe({
6772
next: ({ user }) => void this.router.navigate(['/profile/', user.username]),

0 commit comments

Comments
 (0)