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:
jordi fita mas 2023-07-02 20:06:45 +02:00
parent f917ce84dd
commit a068784a22
1 changed files with 2 additions and 2 deletions

View File

@ -38,14 +38,14 @@ func IndexExpenses(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
return
}
page := &expensesIndexPage{
Expenses: mustCollectExpenseEntries(r.Context(), conn, company, filters),
Expenses: mustCollectExpenseEntries(r.Context(), conn, filters),
TotalAmount: mustComputeExpensesTotalAmount(r.Context(), conn, filters),
Filters: filters,
}
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)
rows := conn.MustQuery(ctx, fmt.Sprintf(`
select expense.slug