Skip to content
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

fix: projects and tasks #305

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

olaherrdahl
Copy link
Contributor

Fixes api.Project.objects.all() since color is now a string.

Fixes api.Task.objects.all() since that response data is still wrapped in an envelope.

Fixes api.Task.objects.all() since that response data is still wrapped in an envelope.
@AuHau
Copy link
Owner

AuHau commented Mar 29, 2023

Thanks for the PR. Do you target the new v9 of API? If so then this project still uses the old v8 version as you can see here: https://github.com/AuHau/toggl-cli/blob/master/toggl/toggl.py#L5 so I am not sure if your changes applies here?

@olaherrdahl
Copy link
Contributor Author

@AuHau yeah, I thinked you missed that the PR is targeting your new-api-version branch.

Comment on lines +226 to +227
if isinstance(fetched_entities, dict):
fetched_entities = fetched_entities.get('data')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I am wondering if it wouldn't make more sense to have this in utils.toggl? I guess the main fetching (eq. GET requests) are coming from the TogglSet but maybe it would be applicable also for other responses? WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really have no strong opinion here since I only made these changes to get a broken tool using this project up and running again and have very little context.

But if I read this correct, https://github.com/AuHau/toggl-cli/blob/feat/new-api-version/toggl/utils/others.py#L149 , it should return an dict right?
And I think the problem was that for calls without the envelop, it return a list.

I do think it would be easier to discuss that on the other PR once all changes needed for V9 are identified.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@AuHau
Copy link
Owner

AuHau commented Mar 30, 2023

Oh you are right! Ups, sorry about that! 🙈

@AuHau AuHau changed the title Version 9 fixes for get projects and tasks. fix: projects and tasks Mar 31, 2023
@AuHau AuHau merged commit ade5976 into AuHau:feat/new-api-version Mar 31, 2023
andreabak pushed a commit to andreabak/toggl-cli that referenced this pull request May 20, 2024
AuHau pushed a commit that referenced this pull request Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants