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

api/v4/datasets doesn't return all shared datasets #15767

Merged

Conversation

alasarr
Copy link
Contributor

@alasarr alasarr commented Jul 29, 2020

Story details: https://app.clubhouse.io/cartoteam/story/95768

It includes the datasets shared with the org and the datasets shared with any group the user belongs to

@amiedes amiedes self-requested a review July 30, 2020 07:39
Copy link
Contributor

@manmorjim manmorjim left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@amiedes amiedes left a comment

Choose a reason for hiding this comment

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

I feel a more robust way of fixing this would be to extract the query-related logic out of the controller, and then write unit tests for it. Moving this kind of logic out of the controllers has as benefit that writing tests for it without worrying about session and request cycle is much easier 💅 .

As an example, you can see it's done that way for Carto::VisualizationQueryBuilder.

Since there's a meeting this afternoon with the client, and this suggestion implies a refactor, I leave to you the decision of tackling this now or not 🙂

@alasarr
Copy link
Contributor Author

alasarr commented Jul 30, 2020

Agree @amiedes, in fact, I see similar queries in other places like user_db_service.db. However, I didn't want to start a refactor for a bug, but I'll add this refactor to the backlog.

@alasarr alasarr merged commit 5db1536 into master Jul 30, 2020
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.

3 participants