From e3ee7f0922b7d327af5313214f6e82000bc3baa4 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sat, 13 Jul 2024 17:37:23 +0530 Subject: [PATCH] fix: initialize user post registration and load into cqrs_es framework --- src/identity/adapters/output/db/postgres/user_view.rs | 1 + src/identity/application/aggregate.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/identity/adapters/output/db/postgres/user_view.rs b/src/identity/adapters/output/db/postgres/user_view.rs index 2a51b7f..0c53299 100644 --- a/src/identity/adapters/output/db/postgres/user_view.rs +++ b/src/identity/adapters/output/db/postgres/user_view.rs @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2024 Aravinth Manivannan // // 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}; diff --git a/src/identity/application/aggregate.rs b/src/identity/application/aggregate.rs index f89f75c..08b194a 100644 --- a/src/identity/application/aggregate.rs +++ b/src/identity/application/aggregate.rs @@ -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())