fix: initialize user post registration and load into cqrs_es framework
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2024-07-13 17:37:23 +05:30
parent 6609e52632
commit e3ee7f0922
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 2 additions and 1 deletions

View file

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
use async_trait::async_trait;
use cqrs_es::persist::GenericQuery;
use cqrs_es::persist::{PersistenceError, ViewContext, ViewRepository};

View file

@ -72,7 +72,7 @@ impl Aggregate for User {
fn apply(&mut self, event: Self::Event) {
match event {
UserEvent::UserRegistered(e) => {
UserBuilder::default()
*self = UserBuilder::default()
.username(e.username().into())
.email(e.email().into())
.hashed_password(e.hashed_password().into())