Skip to content

Commit d77db25

Browse files
committed
fix: update ObjectStackClient initialization and correct discoveryInfo endpoints
1 parent 2653dd9 commit d77db25

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

apps/console/src/App.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,16 @@ export function AppContent() {
104104

105105
async function initializeClient() {
106106
try {
107-
const stackClient = new ObjectStackClient({ baseUrl: '/api/v1' });
107+
const stackClient = new ObjectStackClient({ baseUrl: '' });
108108
await new Promise(resolve => setTimeout(resolve, 500));
109109
await stackClient.connect();
110+
111+
// FIX: MSW Mock Server returns incorrect 'endpoints' in discovery.
112+
// The 'routes' property has the correct paths with /v1 prefix.
113+
if (stackClient.discoveryInfo && stackClient.discoveryInfo.routes) {
114+
stackClient.discoveryInfo.endpoints = stackClient.discoveryInfo.routes;
115+
}
116+
110117
setClient(stackClient);
111118
setDataSource(new ObjectStackDataSource(stackClient));
112119
} catch (err) {

apps/console/src/components/ObjectView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
5858
const handleViewChange = (newViewId: string) => {
5959
if (viewId) {
6060
// In view route, replace last segment
61-
navigate(`../view/${newViewId}`, { relative: "path" });
61+
navigate(`../${newViewId}`, { relative: "path" });
6262
} else {
6363
// In root route, append view
6464
navigate(`view/${newViewId}`);

0 commit comments

Comments
 (0)