File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import {
32
32
initialState ,
33
33
toGuestStayAccountId ,
34
34
} from '../guestStayAccount' ;
35
+ import { getGuestStayDetails } from '../guestStayDetails' ;
35
36
36
37
export const handle = CommandHandler ( evolve , initialState ) ;
37
38
@@ -186,10 +187,10 @@ export const guestStayAccountsApi =
186
187
on ( async ( request : GetShoppingCartRequest ) => {
187
188
const guestStayAccountId = parseGuestStayAccountId ( request . params ) ;
188
189
189
- const result = await eventStore . aggregateStream ( guestStayAccountId , {
190
- evolve ,
191
- initialState ,
192
- } ) ;
190
+ const result = await getGuestStayDetails (
191
+ eventStore ,
192
+ guestStayAccountId ,
193
+ ) ;
193
194
194
195
if ( result === null ) return NotFound ( ) ;
195
196
Original file line number Diff line number Diff line change
1
+ import { type EventStore } from '@event-driven-io/emmett' ;
1
2
import type { GuestStayAccountEvent } from './guestStayAccount' ;
2
3
3
4
export type NotExisting = { status : 'NotExisting' } ;
@@ -83,3 +84,12 @@ export const evolve = (
83
84
}
84
85
}
85
86
} ;
87
+
88
+ export const getGuestStayDetails = (
89
+ eventStore : EventStore ,
90
+ guestStayAccountId : string ,
91
+ ) =>
92
+ eventStore . aggregateStream ( guestStayAccountId , {
93
+ evolve,
94
+ initialState,
95
+ } ) ;
You can’t perform that action at this time.
0 commit comments