Merge pull request 'fix: initialize user post registration and load into cqrs_es framework' (#25) from fix-initialize-user into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #25
This commit is contained in:
commit
0cdff43fca
2 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use cqrs_es::persist::GenericQuery;
|
use cqrs_es::persist::GenericQuery;
|
||||||
use cqrs_es::persist::{PersistenceError, ViewContext, ViewRepository};
|
use cqrs_es::persist::{PersistenceError, ViewContext, ViewRepository};
|
||||||
|
|
|
@ -72,7 +72,7 @@ impl Aggregate for User {
|
||||||
fn apply(&mut self, event: Self::Event) {
|
fn apply(&mut self, event: Self::Event) {
|
||||||
match event {
|
match event {
|
||||||
UserEvent::UserRegistered(e) => {
|
UserEvent::UserRegistered(e) => {
|
||||||
UserBuilder::default()
|
*self = UserBuilder::default()
|
||||||
.username(e.username().into())
|
.username(e.username().into())
|
||||||
.email(e.email().into())
|
.email(e.email().into())
|
||||||
.hashed_password(e.hashed_password().into())
|
.hashed_password(e.hashed_password().into())
|
||||||
|
|
Loading…
Reference in a new issue