Fix warnings

This commit is contained in:
Shadowfacts 2020-06-07 11:14:01 -04:00
parent 58b3361623
commit 4d8bc7ad38
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
11 changed files with 10 additions and 21 deletions

View File

@ -1,7 +1,6 @@
defmodule FrenzyWeb.AccountController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, User, FervorClient}
alias FrenzyWeb.Router.Helpers, as: Routes
alias FrenzyWeb.Endpoint
def show(conn, _params) do
@ -42,7 +41,7 @@ defmodule FrenzyWeb.AccountController do
^confirm ->
changeset = User.change_password_changeset(user, %{password: new})
{:ok, user} = Repo.update(changeset)
{:ok, _user} = Repo.update(changeset)
conn
|> put_flash(:info, "Password changed.")
@ -80,7 +79,7 @@ defmodule FrenzyWeb.AccountController do
fever_password: new
})
{:ok, user} = Repo.update(changeset)
{:ok, _user} = Repo.update(changeset)
conn
|> put_flash(:info, "Fever password changed.")

View File

@ -1,7 +1,6 @@
defmodule FrenzyWeb.FeedController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, Group, Feed, Item, Pipeline, Paginator}
alias FrenzyWeb.Router.Helpers, as: Routes
alias FrenzyWeb.Endpoint
import Ecto.Query

View File

@ -1,6 +1,6 @@
defmodule FrenzyWeb.Fervor.ItemsController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, FervorClient, Group, Feed, Filter, Item}
alias Frenzy.{Repo, Item}
import Ecto.Query
alias FrenzyWeb.Fervor.Paginator

View File

@ -1,7 +1,6 @@
defmodule FrenzyWeb.Fervor.OauthController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, FervorClient, User, ApprovedClient}
alias FrenzyWeb.Router.Helpers, as: Routes
alias FrenzyWeb.Endpoint
def authorize_get(conn, params) do

View File

@ -1,18 +1,15 @@
defmodule FrenzyWeb.Fervor.Paginator do
import Ecto.Query
def paginate(query, %{"max_id" => max_id} = params) do
limit = Map.get(params, "limit", 20)
def paginate(query, %{"max_id" => max_id}) do
from(o in query, where: o.id < ^max_id, order_by: [desc: :id])
end
def paginate(query, %{"min_id" => min_id} = params) do
limit = Map.get(params, "limit", 20)
def paginate(query, %{"min_id" => min_id}) do
from(o in query, where: o.id > ^min_id, order_by: [asc: :id])
end
def paginate(query, %{"since_id" => since_id} = params) do
limit = Map.get(params, "limit", 20)
def paginate(query, %{"since_id" => since_id}) do
from(o in query, where: o.id > ^since_id, order_by: [desc: :id])
end

View File

@ -1,7 +1,6 @@
defmodule FrenzyWeb.GroupController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, Group, Feed, Item, Paginator}
alias FrenzyWeb.Router.Helpers, as: Routes
alias FrenzyWeb.Endpoint
import Ecto.Query

View File

@ -1,7 +1,6 @@
defmodule FrenzyWeb.ItemController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, Feed, Item}
alias FrenzyWeb.Router.Helpers, as: Routes
alias Frenzy.{Repo, Item}
alias FrenzyWeb.Endpoint
plug :user_owns_item

View File

@ -1,9 +1,7 @@
defmodule FrenzyWeb.LoginController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, User}
alias FrenzyWeb.Router.Helpers, as: Routes
alias FrenzyWeb.Endpoint
import Ecto.Query
def login(conn, params) do
render(conn, "login.html", %{
@ -29,7 +27,7 @@ defmodule FrenzyWeb.LoginController do
end
end
def logout(conn, params) do
def logout(conn, _params) do
conn
|> put_flash(:info, "Logged out.")
|> clear_session()

View File

@ -1,7 +1,6 @@
defmodule FrenzyWeb.PipelineController do
use FrenzyWeb, :controller
alias Frenzy.{Repo, Pipeline}
alias FrenzyWeb.Router.Helpers, as: Routes
alias FrenzyWeb.Endpoint
import Ecto.Query

View File

@ -12,7 +12,7 @@
<% end %>
</li>
<li class="list-group-item">
<%= form_for @conn, Routes.account_path(@conn, :export), [method: :post, class: "mt-2"], fn f -> %>
<%= form_for @conn, Routes.account_path(@conn, :export), [method: :post, class: "mt-2"], fn _f -> %>
<%= submit "Export OPML", class: "btn btn-primary" %>
<% end %>
</li>

View File

@ -1,6 +1,6 @@
defmodule FrenzyWeb.LayoutView do
use FrenzyWeb, :view
alias Frenzy.{Repo, Group, Feed}
alias Frenzy.{Repo, Group}
import Ecto.Query
def user_groups(user) do