Vovchikan

Vovchikan

How to remove PUT method from phx.routes?

Phoenix version - 1.6.6
My phoenix routes:

 swagger_ui_path  GET    /getmsg/swaggerui         OpenApiSpex.Plug.SwaggerUI [path: "/getmsg/api/openapi"]
render_spec_path  GET    /getmsg/api/openapi       OpenApiSpex.Plug.RenderSpec []
 auth_token_path  POST   /getmsg/api/auth-tokens   GetmsgApi.AuthTokenController :create
    message_path  GET    /getmsg/api/messages      GetmsgApi.MessageController :index
    message_path  GET    /getmsg/api/messages/:id  GetmsgApi.MessageController :show
    message_path  PATCH  /getmsg/api/messages/:id  GetmsgApi.MessageController :update
                  PUT    /getmsg/api/messages/:id  GetmsgApi.MessageController :update

How to remove PUT method? I don’t need it.

Marked As Solved

rustyonetwo

rustyonetwo

Did this come up automatically using resources "/getmsg/api/messages", MessageController ? If so the PUT verb was generated automatically. You can avoid this by excluding the :update routes in the controller with resources "/getmsg/api/messages", MessageController, except: [:update] and then creating another route with patch "/getmsg/api/messages", MessageController, :update. If you’re not getting that by using resources then we’d probably need to take a look at the relevant part of your router.

Also Liked

LostKobrakai

LostKobrakai

This needs to be

patch "/getmsg/api/messages/:id", MessageController, :update

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New

We're in Beta

About us Mission Statement