Remove unused company parameter from mustCollectExpenseEntries
The company is now in the filters form and there is no need for that company parameter.
This commit is contained in:
parent
f917ce84dd
commit
a068784a22
|
@ -38,14 +38,14 @@ func IndexExpenses(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
page := &expensesIndexPage{
|
page := &expensesIndexPage{
|
||||||
Expenses: mustCollectExpenseEntries(r.Context(), conn, company, filters),
|
Expenses: mustCollectExpenseEntries(r.Context(), conn, filters),
|
||||||
TotalAmount: mustComputeExpensesTotalAmount(r.Context(), conn, filters),
|
TotalAmount: mustComputeExpensesTotalAmount(r.Context(), conn, filters),
|
||||||
Filters: filters,
|
Filters: filters,
|
||||||
}
|
}
|
||||||
mustRenderMainTemplate(w, r, "expenses/index.gohtml", page)
|
mustRenderMainTemplate(w, r, "expenses/index.gohtml", page)
|
||||||
}
|
}
|
||||||
|
|
||||||
func mustCollectExpenseEntries(ctx context.Context, conn *Conn, company *Company, filters *expenseFilterForm) []*ExpenseEntry {
|
func mustCollectExpenseEntries(ctx context.Context, conn *Conn, filters *expenseFilterForm) []*ExpenseEntry {
|
||||||
where, args := filters.BuildQuery(nil)
|
where, args := filters.BuildQuery(nil)
|
||||||
rows := conn.MustQuery(ctx, fmt.Sprintf(`
|
rows := conn.MustQuery(ctx, fmt.Sprintf(`
|
||||||
select expense.slug
|
select expense.slug
|
||||||
|
|
Loading…
Reference in New Issue