Skip to content

Commit 8e94ca9

Browse files
committed
make it work on dev
1 parent 8e5d686 commit 8e94ca9

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

packages/atlas-service/src/atlas-service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ export class AtlasService {
8383
path
8484
)}`;
8585
}
86+
userDataEndpoint(path?: string): string {
87+
return `https://cluster-connection.cloud-dev.mongodb.com/userData${normalizePath(
88+
path
89+
)}`;
90+
}
8691
driverProxyEndpoint(path?: string): string {
8792
return `${this.config.ccsBaseUrl}${normalizePath(path)}`;
8893
}
@@ -134,6 +139,7 @@ export class AtlasService {
134139
const authHeaders = await this.authService.getAuthHeaders();
135140
return this.fetch(url, {
136141
...init,
142+
credentials: 'include',
137143
headers: {
138144
...init?.headers,
139145
...authHeaders,

packages/compass-sidebar/src/components/multiple-connections/navigation/navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function Navigation({
104104
const isDataModelingEnabled = usePreference('enableDataModeling');
105105
return (
106106
<div>
107-
{hasWorkspacePlugin('My Queries') && (
107+
{hasWorkspacePlugin('My Queries') && true && (
108108
<NavigationItem
109109
onClick={openMyQueriesWorkspace}
110110
glyph="CurlyBraces"

packages/compass-user-data/src/user-data.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class AtlasUserData<T extends z.Schema> extends IUserData<T> {
309309

310310
async write(id: string, content: z.input<T>): Promise<boolean> {
311311
const url = await this.getResourceUrl(
312-
`${this.dataType}/${this.orgId}/${this.projectId}`
312+
`${this.dataType}/${this.orgId}/${this.projectId}/${id}`
313313
);
314314

315315
try {
@@ -321,10 +321,8 @@ export class AtlasUserData<T extends z.Schema> extends IUserData<T> {
321321
'Content-Type': 'application/json',
322322
},
323323
body: JSON.stringify({
324-
id: id,
325324
data: this.serialize(content),
326325
createdAt: new Date(),
327-
projectId: this.projectId,
328326
}),
329327
});
330328

@@ -417,7 +415,10 @@ export class AtlasUserData<T extends z.Schema> extends IUserData<T> {
417415
headers: {
418416
'Content-Type': 'application/json',
419417
},
420-
body: this.serialize(newData),
418+
body: JSON.stringify({
419+
data: this.serialize(newData),
420+
createdAt: new Date(),
421+
}),
421422
}
422423
);
423424
return true;

packages/compass-web/src/entrypoint.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ const WithStorageProviders: React.FC<{ orgId: string; projectId: string }> = ({
103103
}) => {
104104
const atlasService = useAtlasServiceContext();
105105
const authenticatedFetch = atlasService.authenticatedFetch.bind(atlasService);
106-
const getResourceUrl = (path?: string) =>
107-
Promise.resolve(atlasService.tempEndpoint(`/userdata/${path || ''}`));
106+
const getResourceUrl = (path?: string) => {
107+
const url = atlasService.userDataEndpoint(`/${path || ''}`);
108+
console.log('getResourceUrl called with path:', path, '-> URL:', url);
109+
return Promise.resolve(url);
110+
};
108111
const pipelineStorage = useRef(
109112
new CompassPipelineStorage({
110113
orgId,

0 commit comments

Comments
 (0)