leaf
I have two routers in my app. I am forwarding api calls which start with /admin_api/v1 to a child router from the main router.
forward "/admin_api/v1", Admin.ApiWeb.Router
It works fine when I test it with Postman. Both routers are working as expected. This is path in the child router.
qa_question_path DELETE /qa_questions/:nuton_id NutonAdminApi.QaQuestionController :delete
qa_question_path PUT /qa_questions/:nuton_id NutonAdminApi.QaQuestionController :update
This is route in the parent route for the same entity.
qa_question_path GET /api/v1/qa_questions NutonApi.QaQuestionController :index
qa_question_path POST /api/v1/qa_questions NutonApi.QaQuestionController :create
Their path names are the same but their EP are different.
When I run following test case
json_resp =
put(
conn,
qa_question_path(conn, :update, id),
params
)
|> json_response(200)
It gives me this error:
** (ArgumentError) no action :update for ApiWeb.Router.Helpers.qa_question_path/3. The following actions/clauses are supported:
qa_question_path(conn_or_endpoint, :create, params \\ [])
qa_question_path(conn_or_endpoint, :index, params \\ [])
qa_question_path(conn_or_endpoint, :show, nuton_id, params \\ [])
I understand the issue because of the same path names in both routes . It just checks if the path exist in the parent and raise an error, but how can I include child router in the test cases so that it will check if the path exist in it.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
New episode with Louis Pilfold - the most detailed conversation about Gleam’s design I’ve come across.
Worth knowing for the Elixir comm...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming









