Allow empty project submission, remove redundant customer list
All checks were successful
CI / test (push) Successful in 1m44s

This commit is contained in:
2025-06-19 09:56:54 +02:00
parent 1bf7aa8a66
commit f6a92bc99e
3 changed files with 98 additions and 86 deletions

View File

@@ -51,7 +51,7 @@ func (p Project) String() string {
return fmt.Sprintf("%d: %s (%s)", p.ID, p.Name, p.CustomerName)
}
func (p Project) GetID() int { return p.ID }
func (p Project) GetName() string { return p.Name }
func (p Project) GetName() string { return p.Name + " (" + p.CustomerName + ")" }
func (a APIClient) GetProjects() (Projects, error) {
// GET /projects.json
@@ -231,8 +231,8 @@ type requestAddTimeEntry struct {
RequestTimeEntryHolder struct {
DateAt string `json:"date_at"`
Minutes int `json:"minutes"`
ProjectID int `json:"project_id,omit_empty"`
ServiceID int `json:"service_id,omit_empty"`
ProjectID int `json:"project_id,omitempty"`
ServiceID int `json:"service_id,omitempty"`
Note string `json:"note"`
} `json:"time_entry"`
}