Closed nelsonic closed 1 year ago
While QA-testing the #345 PR, getting the following error:
ā³ AppWeb.AppLive.mount/3, at: lib/app_web/live/app_live.ex:33 [debug] QUERY OK source="items" db=0.5ms queue=0.5ms idle=534.5ms SELECT i0."id", i0."cid", i0."person_id", i0."status", i0."text", i0."inserted_at", i0."updated_at" FROM "items" AS i0 WHERE ((i0."status" = $1) AND (i0."person_id" = $2)) [7, 0] ā³ App.Item.get_draft_item/1, at: lib/app/item.ex:101 [info] Sent 500 in 66ms [debug] Converted error {:badkey, :status, nil} to 500 response [error] #PID<0.715.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.714.0>, stream id 1) terminated Server: localhost:4000 (http) Request: GET / ** (exit) an exception was raised: ** (KeyError) key :status not found in: nil If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map (app 1.0.0) lib/app_web/live/app_live.ex:403: AppWeb.AppLive.active?/1 (elixir 1.15.4) lib/enum.ex:4265: Enum.filter_list/2 (app 1.0.0) lib/app_web/live/app_live.ex:486: AppWeb.AppLive.filter_items/3 (app 1.0.0) lib/app_web/live/app_live.html.heex:146: anonymous fn/2 in AppWeb.AppLive.render/1 (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:398: Phoenix.LiveView.Diff.traverse/7 (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:544: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7 (elixir 1.15.4) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3 (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:396: Phoenix.LiveView.Diff.traverse/7 (phoenix_live_view 0.18.18) lib/phoenix_live_view/diff.ex:139: Phoenix.LiveView.Diff.render/3 (phoenix_live_view 0.18.18) lib/phoenix_live_view/static.ex:252: Phoenix.LiveView.Static.to_rendered_content_tag/4 (phoenix_live_view 0.18.18) lib/phoenix_live_view/static.ex:135: Phoenix.LiveView.Static.render/3 (phoenix_live_view 0.18.18) lib/phoenix_live_view/controller.ex:39: Phoenix.LiveView.Controller.live_render/3 (phoenix 1.7.7) lib/phoenix/router.ex:430: Phoenix.Router.__call__/5 (app 1.0.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.plug_builder_call/2 (app 1.0.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.call/2 (phoenix 1.7.7) lib/phoenix/endpoint/sync_code_reload_plug.ex:22: Phoenix.Endpoint.SyncCodeReloadPlug.do_call/4 (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2
Need to dig into why this is happening. š§āš» š
Fixed in #345 by adding status?/1 function in lib/app_web/live/app_live.ex ā
status?/1
lib/app_web/live/app_live.ex
While QA-testing the #345 PR, getting the following error:
Need to dig into why this is happening. š§āš» š