Skip to content

Instantly share code, notes, and snippets.

@bvjebin
Last active August 31, 2018 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvjebin/11affb8831819f873705bae548c394eb to your computer and use it in GitHub Desktop.
Save bvjebin/11affb8831819f873705bae548c394eb to your computer and use it in GitHub Desktop.
Export API Endpoint
defmodule Example.AdminController do
use Example, :controller
def export(conn, %{"email" => email}) do
Example.User.get_dump()
|> Example.Export.export_and_email(email)
json(conn, %{
success: true,
message: "Your request is accepted. Data will be emailed shortly"
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment