package http

import "git.javil.eu/jacob1123/budgeteer"

type TemplateData struct {
	Token         budgeteer.Token
	Budget        *budgeteer.Budget
	budgetService budgeteer.ModelService
}

func (d TemplateData) GetBudgets() []*budgeteer.Budget {
	userID := d.Token.GetID()
	budgets, err := d.budgetService.BudgetsForUser(userID)
	if err != nil {
		return nil
	}

	return budgets
}
