Skip to content

Commit

Permalink
Merge pull request #14 from dvic/append_to_stream_opts
Browse files Browse the repository at this point in the history
Pass opts in append_to_stream
  • Loading branch information
slashdotdash authored Jan 9, 2024
2 parents 2991340 + 0739a1e commit 905974e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/commanded/event_store/adapters/event_store.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ defmodule Commanded.EventStore.Adapters.EventStore do
end

@impl Commanded.EventStore.Adapter
def append_to_stream(adapter_meta, stream_uuid, expected_version, events) do
def append_to_stream(adapter_meta, stream_uuid, expected_version, events, opts \\ []) do
{event_store, name} = extract_adapter_meta(adapter_meta)

events = Enum.map(events, &Mapper.to_event_data/1)

event_store.append_to_stream(stream_uuid, expected_version, events, name: name)
opts = Keyword.put(opts, :name, name)
event_store.append_to_stream(stream_uuid, expected_version, events, opts)
end

@impl Commanded.EventStore.Adapter
Expand Down

0 comments on commit 905974e

Please sign in to comment.