feymartynov / ex_operation

A library for making domain operations in Elixir
Other
35 stars 5 forks source link

SubOperation values not passing #2

Closed churcho closed 4 years ago

churcho commented 4 years ago

I can't seem to be able to get the values passed into my suboperation

Code sample:

def call(operation) do
 operation
  |> step(:get_login_type, &get_login_type(operation.params, &1))
  |> step(:login, &get_user(operation.context, &1, operation.params))
  |> step(:verified_user, &verify_password(operation.context, &1, operation.params))
  |>suboperation(GenerateTokenCommand, operation.params, context: &%{user: &1.verified_user})
end

I am unable to access the params in my GenerateTokenCommand

churcho commented 4 years ago

Closing this. Found that I have to include the params with use ExOperation.Operation to have them in the next operation.