-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement initial list timeentries command #7
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ❤️ thanks for your idea and effort. I'd love to put this into code after shaping it up a little bit
User FilterOption = iota | ||
) | ||
|
||
func UserFilter(name string) requests.Filter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 I'd love to extend this filter to the - admittedly not everywhere used - filter interface. This one is used only in the work package resource, and I planned to rewrite every filter to it. So, it'd be nice to have this new filter already taking the desired form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can imagine that there are some confusions :D especially as the code is half implemented around the filters. So, we can pair on it, if you want.
|
||
func All() ([]*models.TimeEntry, error) { | ||
var filters []requests.Filter | ||
filters = append(filters, UserFilter("me")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 I understand that you want to fetch only the time entries assigned to me
on a default fetch. That makes sense, but the logic for that should be in the command, not in the read function IMHO. this also gets easier, if the filter is using the "new and shiny" implementation.
1cd9a3e
to
b5ab3d9
Compare
An initial patch to support listing (personal) time entries. I wrote this to "scratch an itch" - and make my own time tracking easier.
Obviously full CRUD would be nice, but this is just a start.
Also, since this is the first go code I've written, please forgive if it not idiomatic!