File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
compass-generative-ai/src Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,13 @@ export class AtlasAiService {
239239 connectionInfo ?: ConnectionInfo
240240 ) {
241241 if ( this . apiURLPreset === 'cloud' ) {
242+ const atlasMetadata = connectionInfo ?. atlasMetadata ;
243+ if ( ! atlasMetadata ) {
244+ throw new Error (
245+ "Can't perform generative ai request: atlasMetadata is not available"
246+ ) ;
247+ }
248+
242249 if ( urlId === 'user-access' ) {
243250 return this . atlasService . cloudEndpoint (
244251 aiURLConfig [ this . apiURLPreset ] [ urlId ] (
@@ -247,13 +254,6 @@ export class AtlasAiService {
247254 ) ;
248255 }
249256
250- const atlasMetadata = connectionInfo ?. atlasMetadata ;
251- if ( ! atlasMetadata ) {
252- throw new Error (
253- "Can't perform generative ai request: atlasMetadata is not available"
254- ) ;
255- }
256-
257257 return this . atlasService . cloudEndpoint (
258258 aiURLConfig [ this . apiURLPreset ] [ urlId ] ( atlasMetadata . projectId )
259259 ) ;
Original file line number Diff line number Diff line change @@ -59,9 +59,7 @@ import { useCompassWebLoggerAndTelemetry } from './logger-and-telemetry';
5959import { type TelemetryServiceOptions } from '@mongodb-js/compass-telemetry' ;
6060import { WorkspaceTab as WelcomeWorkspaceTab } from '@mongodb-js/compass-welcome' ;
6161
62- const WithAtlasProviders : React . FC < {
63- projectId : string ;
64- } > = ( { children } ) => {
62+ const WithAtlasProviders : React . FC = ( { children } ) => {
6563 return (
6664 < AtlasCloudAuthServiceProvider >
6765 < AtlasServiceProvider >
@@ -319,7 +317,7 @@ const CompassWeb = ({
319317 < PreferencesProvider value = { preferencesAccess . current } >
320318 < LoggerProvider value = { logger } >
321319 < TelemetryProvider options = { telemetryOptions . current } >
322- < WithAtlasProviders projectId = { projectId } >
320+ < WithAtlasProviders >
323321 < AtlasCloudConnectionStorageProvider
324322 orgId = { orgId }
325323 projectId = { projectId }
You can’t perform that action at this time.
0 commit comments