-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(getApiUrl): Use getApiUrl in all the places and update types to require it #108096
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
base: master
Are you sure you want to change the base?
Conversation
| ConfigStore.set('user', UserFixture({isSuperuser: true})); | ||
|
|
||
| const provider = {slug: 'github'}; | ||
| const configUrl = `/api/0/organizations/${org.slug}/integrations/?provider_key=${provider.slug}&includeConfig=0`; |
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.
the /api/0 prefix isn't needed.
We'll add the baseUrl if it's missing: https://github.com/getsentry/sentry/blob/master/static/app/api.tsx#L190-L215
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.
This was returning undefined for payload type, and complaining about having a TApiPath in the query.
The problem seemed to be that we were setting queryKey: [path] in the case when skipToken is used. So i changed it up, when we have skipToken we'll still try to generate the ApiUrl with getApiUrl(), which now accepts a skipToken as well, and will return the unmodified path. So at least we can pass the correct type into queryKey. Also we'll set enabled: false now, in addition to passing queryFn: skipToken
| meta: EventsMetaType; | ||
| }>( | ||
| [ | ||
| `/api/0/organizations/${organization.slug}/spans-samples/`, |
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.
prefix /api/0 is auto-added. not needed here
|
|
||
| const appSizeQuery: UseApiQueryResult<AppSizeApiResponse, RequestError> = | ||
| useApiQuery<AppSizeApiResponse>( | ||
| // @ts-expect-error TODO(ryan953): Invalid useApiQuery path (should be organization prefix?) |
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.
cc @rbro112
| // @ts-expect-error TODO(ryan953): Invalid useApiQuery path | ||
| `/projects/${organization.slug}/pullrequest-details/${params.repoOrg}/${params.repoName}/${params.prId}/`, |
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.
cc @rbro112
take a look at this url
| // @ts-expect-error TODO(ryan953): Invalid useApiQuery path | ||
| `/organizations/${orgSlug}/seer/explorer-chat/${runId ? `${runId}/` : ''}`, |
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.
cc @aliu39 take a look at this url. when runId is undefined i think we should be hitting /explorer-update/$runId/ or /explorer-chat/$runId (and this one is missing the trailing slash in urls.py)
…always be a stringy thing
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
No description provided.