Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
17
lib/eventos_web/views/request_view.ex
Normal file
17
lib/eventos_web/views/request_view.ex
Normal file
@@ -0,0 +1,17 @@
|
||||
defmodule EventosWeb.RequestView do
|
||||
use EventosWeb, :view
|
||||
alias EventosWeb.RequestView
|
||||
|
||||
def render("index.json", %{requests: requests}) do
|
||||
%{data: render_many(requests, RequestView, "request.json")}
|
||||
end
|
||||
|
||||
def render("show.json", %{request: request}) do
|
||||
%{data: render_one(request, RequestView, "request.json")}
|
||||
end
|
||||
|
||||
def render("request.json", %{request: request}) do
|
||||
%{id: request.id,
|
||||
state: request.state}
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user