Order information exporting in Excel-format
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
defmodule OsuuspuutarhaWeb.Exports.OrderController do
|
||||
use OsuuspuutarhaWeb, :controller
|
||||
|
||||
alias Osuuspuutarha.Orders
|
||||
|
||||
def index(conn, _params) do
|
||||
orders = Orders.list_orders()
|
||||
|
||||
conn
|
||||
|> put_resp_content_type("text/xlsx")
|
||||
|> put_resp_header("content-disposition", "attachment; filename=\"tilaukset.xlxs\"")
|
||||
|> render("tilaukset.xlsx", %{orders: orders})
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user