Skip to content

Commit

Permalink
feat: correctly redirects to landing page after sending email contact
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed Aug 25, 2024
1 parent 2be9c9c commit 6a07deb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/pescarte_web/controllers/contact_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ defmodule PescarteWeb.ContactController do

conn
|> put_flash(:info, "Email enviado com sucesso!")
|> redirect(~p"/")

{:error, reason} ->
Logger.error("""
Expand All @@ -47,11 +48,13 @@ defmodule PescarteWeb.ContactController do

conn
|> put_flash(:error, "Erro ao enviar email.")
|> redirect(~p"/")
end

{:error, _changeset} ->
conn
|> put_flash(:error, "Erro na validação do formulário.")
|> redirect(~p"/")
end
end
end

0 comments on commit 6a07deb

Please sign in to comment.