Browse Source

ref(assistant): Remove v2 parameter in frontent (v1 is gone) (#33329)

Evan Purkhiser 2 years ago
parent
commit
298c07ae0f

+ 1 - 1
src/sentry/testutils/cases.py

@@ -827,7 +827,7 @@ class AcceptanceTestCase(TransactionTestCase):
 
         for item in which:
             res = self.client.put(
-                "/api/0/assistant/?v2",
+                "/api/0/assistant/",
                 content_type="application/json",
                 data=json.dumps({"guide": item, "status": "viewed", "useful": True}),
             )

+ 8 - 7
static/app/actionCreators/guides.tsx

@@ -2,16 +2,17 @@ import GuideActions from 'sentry/actions/guideActions';
 import {Client} from 'sentry/api';
 import ConfigStore from 'sentry/stores/configStore';
 import {trackAnalyticsEvent} from 'sentry/utils/analytics';
+import {run} from 'sentry/utils/apiSentryClient';
 
 const api = new Client();
 
-export function fetchGuides() {
-  api.request('/assistant/?v2', {
-    method: 'GET',
-    success: data => {
-      GuideActions.fetchSucceeded(data);
-    },
-  });
+export async function fetchGuides() {
+  try {
+    const data = await api.requestPromise('/assistant/');
+    GuideActions.fetchSucceeded(data);
+  } catch (error) {
+    run(Sentry => Sentry.captureException(error));
+  }
 }
 
 export function registerAnchor(target: string) {

+ 1 - 1
tests/js/spec/components/modals/commandPaletteModal.spec.jsx

@@ -62,7 +62,7 @@ describe('Command Palette Modal', function () {
       },
     });
     MockApiClient.addMockResponse({
-      url: '/assistant/?v2',
+      url: '/assistant/',
       body: [],
     });
   });

+ 1 - 1
tests/js/spec/components/modals/helpSearchModal.spec.jsx

@@ -46,7 +46,7 @@ describe('Docs Search Modal', function () {
       },
     });
     MockApiClient.addMockResponse({
-      url: '/assistant/?v2',
+      url: '/assistant/',
       body: [],
     });
   });

+ 1 - 1
tests/js/spec/components/modals/sudoModal.spec.jsx

@@ -18,7 +18,7 @@ describe('Sudo Modal', function () {
       },
     });
     Client.addMockResponse({
-      url: '/assistant/?v2',
+      url: '/assistant/',
       body: [],
     });
     Client.addMockResponse({

+ 1 - 1
tests/js/spec/views/app.spec.jsx

@@ -18,7 +18,7 @@ describe('App', function () {
     });
 
     MockApiClient.addMockResponse({
-      url: '/assistant/?v2',
+      url: '/assistant/',
       body: [],
     });
 

+ 1 - 1
tests/js/spec/views/projectTeams.spec.jsx

@@ -235,7 +235,7 @@ describe('ProjectTeams', function () {
       body: {},
     });
     MockApiClient.addMockResponse({
-      url: '/assistant/?v2',
+      url: '/assistant/',
       body: {},
     });
     MockApiClient.addMockResponse({

+ 1 - 1
tests/js/spec/views/settings/organizationDeveloperSettings/index.spec.jsx

@@ -96,7 +96,7 @@ describe('Organization Developer Settings', function () {
         },
       });
       Client.addMockResponse({
-        url: '/assistant/?v2',
+        url: '/assistant/',
         body: [],
       });
       Client.addMockResponse({