From 899244c14581c362f570f104196f8846d5a93468 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Tue, 28 Nov 2017 11:46:17 -0800 Subject: [PATCH] Fix organization invite URL, update Clouxed, fix warning --- lib/code_corps/emails/organization_invite_email.ex | 2 +- lib/code_corps/helpers/query.ex | 4 ++-- mix.lock | 2 +- priv/repo/structure.sql | 4 ++-- test/lib/code_corps/emails/organization_invite_email_test.exs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/code_corps/emails/organization_invite_email.ex b/lib/code_corps/emails/organization_invite_email.ex index 4dc923374..d61567b22 100644 --- a/lib/code_corps/emails/organization_invite_email.ex +++ b/lib/code_corps/emails/organization_invite_email.ex @@ -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 diff --git a/lib/code_corps/helpers/query.ex b/lib/code_corps/helpers/query.ex index 5add71240..a0d58ba4c 100644 --- a/lib/code_corps/helpers/query.ex +++ b/lib/code_corps/helpers/query.ex @@ -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 diff --git a/mix.lock b/mix.lock index d6e408833..d0239fd27 100644 --- a/mix.lock +++ b/mix.lock @@ -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", [], []}, diff --git a/priv/repo/structure.sql b/priv/repo/structure.sql index 4406e0f4a..d69d749df 100644 --- a/priv/repo/structure.sql +++ b/priv/repo/structure.sql @@ -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; diff --git a/test/lib/code_corps/emails/organization_invite_email_test.exs b/test/lib/code_corps/emails/organization_invite_email_test.exs index 9733f4c6f..8d2795bf8 100644 --- a/test/lib/code_corps/emails/organization_invite_email_test.exs +++ b/test/lib/code_corps/emails/organization_invite_email_test.exs @@ -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,