UndefinedFunctionError at GET /produit/PROMENADE/POUSSETTE/900110

function nil.stockmax/0 is undefined

No code available.
nil.stockmax/0
Called with 0 arguments
7
8  def mount(_params, %{"id_session" => id_session, "id_produit" => id_produit, "user" => user, "paniers" => list_panier, "quantites" => list_quantite}, socket) do
9    categories = CatRequette.get_all_categorie()
10    produit = ProdRequette.get_produit_by_id_produit(id_produit)
11    souscategories = SouscatRequette.get_all_souscategorie()
12    stock = produit.stockmax
13    quantite = stock |> Decimal.to_integer() |> quantite_initial(list_panier,list_quantite, id_produit)
14    categorie_prod = CatRequette.get_categorie_by_id_cat(produit.id_cat)
15    souscategorie_prod = SouscatRequette.get_souscategorie_by_id_souscat(produit.id_souscat)
16    produits_apparentes = ProdRequette.get_produit_apparentes(produit.id_souscat, id_produit)
17    {
BebemayotteWeb.Live.DetailProduitLive.mount/3 docs bebemayotte
315        [:phoenix, :live_view, :mount],
316        %{socket: socket, params: params, session: session},
317        fn ->
318          socket =
319            params
320            |> view.mount(session, socket)
321            |> handle_mount_result!({:mount, 3, view})
322
323          {socket, %{socket: socket, params: params, session: session}}
324        end
325      )
anonymous fn/4 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/4 phoenix_live_view
267span(EventPrefix, StartMetadata, SpanFunction) ->
268    StartTime = erlang:monotonic_time(),
269    DefaultCtx = erlang:make_ref(),
270    execute(EventPrefix ++ [start], #{system_time => erlang:system_time()}, merge_ctx(StartMetadata, DefaultCtx)),
271
272    try {_, #{}} = SpanFunction() of
273      {Result, StopMetadata} ->
274          execute(EventPrefix ++ [stop], #{duration => erlang:monotonic_time() - StartTime}, merge_ctx(StopMetadata, DefaultCtx)),
275          Result
276    catch
277        ?WITH_STACKTRACE(Class, Reason, Stacktrace)
:telemetry.span/3 telemetry
311
312  defp call_mount_and_handle_params!(socket, view, session, params, uri) do
313    mount_params = if socket.router, do: params, else: :not_mounted_at_router
314
315    socket
316    |> Utils.maybe_call_live_view_mount!(view, mount_params, session)
317    |> mount_handle_params(view, params, uri)
318    |> case do
319      {:noreply, %Socket{redirected: {:live, _, _}} = socket} ->
320        {:stop, socket}
321
Phoenix.LiveView.Static.call_mount_and_handle_params!/5 phoenix_live_view
127        action,
128        flash,
129        host_uri
130      )
131
132    case call_mount_and_handle_params!(socket, view, mount_session, conn.params, request_url) do
133      {:ok, socket} ->
134        data_attrs = [
135          phx_view: config.name,
136          phx_session: sign_root_session(socket, router, view, to_sign_session),
137          phx_static: sign_static_token(socket)
Phoenix.LiveView.Static.render/3 phoenix_live_view
30        end
31      end
32
33  """
34  def live_render(%Plug.Conn{} = conn, view, opts \\ []) do
35    case LiveView.Static.render(conn, view, opts) do
36      {:ok, content, socket_assigns} ->
37        conn
38        |> Phoenix.Controller.put_view(LiveView.Static)
39        |> LiveView.Plug.put_cache_headers()
40        |> Phoenix.Controller.render(
Phoenix.LiveView.Controller.live_render/3 docs phoenix_live_view
1defmodule BebemayotteWeb.PageController do
2  use BebemayotteWeb, :controller
3
4  alias Phoenix.LiveView
5  alias Bebemayotte.CatRequette
6  alias Bebemayotte.ProdRequette
BebemayotteWeb.PageController.action/2 bebemayotte
1defmodule BebemayotteWeb.PageController do
2  use BebemayotteWeb, :controller
3
4  alias Phoenix.LiveView
5  alias Bebemayotte.CatRequette
6  alias Bebemayotte.ProdRequette
BebemayotteWeb.PageController.phoenix_controller_pipeline/2 bebemayotte
347    case pipeline.(conn) do
348      %Plug.Conn{halted: true} = halted_conn ->
349        halted_conn
350      %Plug.Conn{} = piped_conn ->
351        try do
352          plug.call(piped_conn, plug.init(opts))
353        else
354          conn ->
355            duration = System.monotonic_time() - start
356            metadata = %{metadata | conn: conn}
357            :telemetry.execute([:phoenix, :router_dispatch, :stop], %{duration: duration}, metadata)
Phoenix.Router.__call__/2 phoenix
1defmodule BebemayotteWeb.Endpoint do
2  use Phoenix.Endpoint, otp_app: :bebemayotte
3
4  # The session will be stored in the cookie and signed,
5  # this means its contents can be read but not tampered with.
6  # Set :encryption_salt if you would also like to encrypt it.
BebemayotteWeb.Endpoint.plug_builder_call/2 bebemayotte
No code available.
BebemayotteWeb.Endpoint."call (overridable 3)"/2 bebemayotte
1defmodule BebemayotteWeb.Endpoint do
2  use Phoenix.Endpoint, otp_app: :bebemayotte
3
4  # The session will be stored in the cookie and signed,
5  # this means its contents can be read but not tampered with.
6  # Set :encryption_salt if you would also like to encrypt it.
BebemayotteWeb.Endpoint.call/2 docs bebemayotte
60
61        {:plug, conn, handler, opts} ->
62          %{adapter: {@connection, req}} =
63            conn =
64              conn
65              |> handler.call(opts)
66              |> maybe_send(handler)
67
68          :telemetry.execute(
69            [:plug_adapter, :call, :stop],
70            %{duration: System.monotonic_time() - start},
Phoenix.Endpoint.Cowboy2Handler.init/4 phoenix
32-optional_callbacks([terminate/3]).
33
34-spec execute(Req, Env) -> {ok, Req, Env}
35	when Req::cowboy_req:req(), Env::cowboy_middleware:env().
36execute(Req, Env=#{handler := Handler, handler_opts := HandlerOpts}) ->
37	try Handler:init(Req, HandlerOpts) of
38		{ok, Req2, State} ->
39			Result = terminate(normal, Req2, State, Handler),
40			{ok, Req2, Env#{result => Result}};
41		{Mod, Req2, State} ->
42			Mod:upgrade(Req2, Env, Handler, State);
:cowboy_handler.execute/2 cowboy
301	end.
302
303execute(_, _, []) ->
304	ok;
305execute(Req, Env, [Middleware|Tail]) ->
306	case Middleware:execute(Req, Env) of
307		{ok, Req2, Env2} ->
308			execute(Req2, Env2, Tail);
309		{suspend, Module, Function, Args} ->
310			proc_lib:hibernate(?MODULE, resume, [Env, Tail, Module, Function, Args]);
311		{stop, _Req2} ->
:cowboy_stream_h.execute/3 cowboy
290%% to simplify the debugging of errors. The proc_lib library
291%% already adds the stacktrace to other types of exceptions.
292-spec request_process(cowboy_req:req(), cowboy_middleware:env(), [module()]) -> ok.
293request_process(Req, Env, Middlewares) ->
294	try
295		execute(Req, Env, Middlewares)
296	catch
297		exit:Reason={shutdown, _}:Stacktrace ->
298			erlang:raise(exit, Reason, Stacktrace);
299		exit:Reason:Stacktrace when Reason =/= normal, Reason =/= shutdown ->
300			erlang:raise(exit, {Reason, Stacktrace}, Stacktrace)
:cowboy_stream_h.request_process/3 cowboy
No code available.
:proc_lib.init_p_do_apply/3 stdlib
Params
cat
"PROMENADE"
id
"900110"
souscat
"POUSSETTE"
Request info
URI:
http://bbmay.fr:80/produit/PROMENADE/POUSSETTE/900110
Query string:
Headers
accept
*/*
connection
Upgrade
host
bbmay.fr
user-agent
claudebot
x-forwarded-for
44.200.249.42
x-real-ip
44.200.249.42
Session
_navigation_history_default
"/produit/PROMENADE/POUSSETTE/900110"