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: Revert to old endpoint temporarily to enable sharing saved queries #24434

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions superset-frontend/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -1372,12 +1372,11 @@ export function popStoredQuery(urlId) {
export function popSavedQuery(saveQueryId) {
return function (dispatch) {
return SupersetClient.get({
endpoint: `/api/v1/saved_query/${saveQueryId}`,
endpoint: `/savedqueryviewapi/api/get/${saveQueryId}`,
Copy link
Member

Choose a reason for hiding this comment

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

@jfrag1 thanks for the change. Is there any reason you opted for this approach as opposed to keeping the new endpoint and relaxing the SavedQueryFilter filter criterion? I guess the merit with the later is it's clearer how this works as opposed to the somewhat magical (and obscure) FAB REST API endpoint.

Copy link
Member Author

@jfrag1 jfrag1 Jun 20, 2023

Choose a reason for hiding this comment

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

@john-bodley The main reason I did it this way is that I'm pretty sure there are several FAB-generated endpoints under the SavedQueryRestApi that utilize the SavedQueryFilter (set as the base_filter on the class), and I didn't want to change the behavior for those. For example, the endpoint that fetches a list of a user's saved queries could start returning a list of all saved queries with that change.

})
.then(({ json }) => {
const queryEditorProps = {
...convertQueryToClient(json.result),
dbId: json.result?.database?.id,
loaded: true,
autorun: false,
};
Expand Down
Loading