Order information exporting in Excel-format

This commit is contained in:
2023-05-28 02:08:26 +03:00
parent 57da4eae55
commit 0f49dc2bf8
8 changed files with 155 additions and 1 deletions

View File

@@ -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