Skip to content

Commit

Permalink
feature: pass in the request body as the command payload
Browse files Browse the repository at this point in the history
  • Loading branch information
akeemphilbert committed Apr 10, 2024
1 parent f633a17 commit 51140bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rest/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ func DefaultWriteController(p *ControllerParams) echo.HandlerFunc {
if projection, ok := p.Projections[resourceType]; ok {
defaultProjection = projection
}
//use the request body as the command payload
response, err := p.CommandDispatcher.Dispatch(ctxt.Request().Context(), ctxt.Logger(), &Command{
Type: commandName,
Type: commandName,
Payload: json.RawMessage(body),
}, &CommandOptions{
ResourceRepository: p.ResourceRepository,
DefaultProjection: defaultProjection,
Expand Down

0 comments on commit 51140bc

Please sign in to comment.