removed search

This commit is contained in:
Bronku 2025-06-23 12:51:36 +02:00
parent d4780ccef4
commit d2ffc76066
6 changed files with 10 additions and 16 deletions

View file

@ -24,7 +24,7 @@ func (h *Server) orders(_ *http.Request) (any, int, error) {
y, m, _ = time.Now().Date()
first, last := monthInterval(y, m)
fmt.Println(first, last)
orders, err := h.s.GetFilteredOrder("", first, last)
orders, err := h.s.GetOrders(first, last)
data := struct {
First string
Last string
@ -34,7 +34,6 @@ func (h *Server) orders(_ *http.Request) (any, int, error) {
}
func (h *Server) ordersSearch(r *http.Request) (any, int, error) {
q := r.URL.Query().Get("q")
from, err := time.Parse("2006-01-02", r.URL.Query().Get("from"))
if err != nil {
from = time.Time{}
@ -44,7 +43,7 @@ func (h *Server) ordersSearch(r *http.Request) (any, int, error) {
to = time.Time{}
}
fmt.Println(from, to)
data, err := h.s.GetFilteredOrder(q, from, to)
data, err := h.s.GetOrders(from, to)
return data, http.StatusOK, err
}

View file

@ -5,9 +5,6 @@ Zamówienia
<main>
<form class="search-container" hx-get="/orders/search" hx-target="#results-table"
hx-trigger="keyup delay:500ms, change">
<label class="search-box">
<input type="search" name="q" placeholder="Wyszukaj po numerze zamówienia">
</label>
<label>Data początkowa
<input type="date" value="{{.First}}" name="from">
</label>