Only show pipelines for the current user

This commit is contained in:
Shadowfacts 2020-05-31 22:49:17 -04:00
parent e429d256d6
commit 929614dab2
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 1 deletions

View File

@ -67,11 +67,12 @@ defmodule FrenzyWeb.FeedController do
end end
def edit(conn, _params) do def edit(conn, _params) do
user = conn.assigns[:user]
feed = conn.assigns[:feed] feed = conn.assigns[:feed]
edit_changeset = Feed.changeset(feed, %{}) edit_changeset = Feed.changeset(feed, %{})
pipelines = pipelines =
Repo.all(Pipeline) Repo.all(from p in Pipeline, where: p.user_id == ^user.id)
|> Enum.map(fn pipeline -> {pipeline.name, pipeline.id} end) |> Enum.map(fn pipeline -> {pipeline.name, pipeline.id} end)
render(conn, "edit.html", %{ render(conn, "edit.html", %{