Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/code_corps/emails/organization_invite_email.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule CodeCorps.Emails.OrganizationInviteEmail do
defp invite_url(code, organization_name) do
query_params = set_params(code, organization_name)
WebClient.url()
|> URI.merge("/invites/organization" <> "?" <> query_params)
|> URI.merge("/organizations/new" <> "?" <> query_params)
|> URI.to_string
end

Expand Down
4 changes: 2 additions & 2 deletions lib/code_corps/helpers/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ defmodule CodeCorps.Helpers.Query do
For each key in the list, the params map has a value for that key,
the query condition for that `{key, value}` is applied to the queriable.
"""
@spec optional_filters(Queryable.t, map, list) :: Queryable.t
@spec optional_filters(Ecto.Queryable.t, map, list) :: Ecto.Queryable.t
def optional_filters(query, %{} = params, [key | other_keys]) do
case params |> Map.get(key |> Atom.to_string) do
nil -> query |> optional_filters(params, other_keys)
value -> query |> where([o], field(o, ^key) == ^value)
end
end
def optional_filters(query, %{} = params , []), do: query
def optional_filters(query, %{} = _params, []), do: query
end
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], []},
"bypass": {:hex, :bypass, "0.8.1", "16d409e05530ece4a72fabcf021a3e5c7e15dcc77f911423196a0c551f2a15ca", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: false]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}]},
"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], []},
"cloudex": {:hex, :cloudex, "1.0.0", "944886f408fd18d4a460cc93c22ee1790aca552599b76b92ad5d8374cf005820", [:mix], [{:httpoison, "~> 0.13.0", [hex: :httpoison, optional: false]}, {:poison, "~> 3.1.0", [hex: :poison, optional: false]}, {:timex, "~> 3.1.7", [hex: :timex, optional: false]}, {:tzdata, "~> 0.5.11", [hex: :tzdata, optional: false]}]},
"cloudex": {:hex, :cloudex, "1.0.1", "51ae96126ef17abb732692ef7bbd8a9c5b26fc01c4a893c42baa219ff9ac562c", [:mix], [{:httpoison, "~> 0.13.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:poison, "~> 3.1.0", [hex: :poison, repo: "hexpm", optional: false]}, {:timex, "~> 3.1.7", [hex: :timex, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.5.11", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], []},
"comeonin": {:hex, :comeonin, "3.2.0", "cb10995a22aed6812667efb3856f548818c85d85394d8132bc116fbd6995c1ef", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, optional: false]}]},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [], []},
Expand Down
4 changes: 2 additions & 2 deletions priv/repo/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
-- PostgreSQL database dump
--

-- Dumped from database version 10.0
-- Dumped by pg_dump version 10.0
-- Dumped from database version 9.5.10
-- Dumped by pg_dump version 10.1

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule CodeCorps.Emails.OrganizationInviteEmailTest do
params =
%{code: invite.code, organization_name: invite.organization_name}
|> URI.encode_query
invite_url = "#{WebClient.url()}/invites/organization?#{params}"
invite_url = "#{WebClient.url()}/organizations/new?#{params}"

assert template_model == %{
invite_url: invite_url,
Expand Down