Drab issue - controller not changing

I was testing that drab library and it worked for me but I have a problem what is in the controller does not change I am doing what is in this link Drab: Server Side User Interface Access of POKE and PEEK counterattack but the initial list that is entered through the controller is not updating me and I do not understand why I am doing the same as in the tutorial, here is my code

 defhandler replace_list(socket, _sender) do
    IO.inspect("entroooo")
    Drab.Live.clean_cache()
    {:ok, payments} = Helpers.list_payments()
    Drab.Live.poke socket, payments: payments
  end

  defhandler replace_in_process(socket, _sender) do
    Drab.Live.clean_cache()
    payments = Helpers.list_transaction()
    Drab.Live.poke socket, payments: payments
  end

controller:

  def index(conn, _params) do
    {:ok, payments} = Helpers.list_payments
    render conn, "index.html", payments: payments
  end

And that’s what happens
image
I do not change the list that is in the computer but instead enter it at the bottom

index.html.drab:

<button class="button blue-kommit"
        type="button"
        drab-click="replace_list">
    <u>Pending </u>
</button> 
<button class="button blue-kommit"
        drab-click="replace_in_process">
    In_process
</button>
<button class="button blue-kommit"
        type="button">
    Completed
</button>
<br>
<table>
<%= for payment <- @payments do %>
  <%= payment.id %><br>
<% end %>
</table>

Hi yessikameliza,
did you get anything while defhandler replace_list(socket, _sender)?

2 Likes

I see the two numbers that are up there below where it says transaction
image
there select the pending button

And can you show us payments = Helpers.list_transaction() in the defhandler replace_in_process(socket, _sender), please?

1 Like

It’s a list of structures, just have that

What do you mean by updating me? Are you waiting for a message from something to get an updated list, or…?

1 Like