Skip to content

Commit 0330b6a

Browse files
committed
Update contexts request
1 parent d1eff85 commit 0330b6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/shared/hooks/useFetchContexts.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import React from 'react';
33
import { Get } from 'shared/utils/request';
44

55
export const getContexts = async (spaceId: string, roomId: string, baseUrl: string) => {
6-
const response = await Get({ path: `/v2/spaces/${spaceId}/rooms/${roomId}/contexts`, baseUrl });
7-
return response?.data?.results as string[];
6+
const response = await Get({ path: `/v3/spaces/${spaceId}/rooms/${roomId}/contexts`, baseUrl });
7+
const { contexts = {} } = response || {}
8+
return Object.keys(contexts) as string[];
89
};
910

1011
export const useFetchContexts = (baseUrl: string) => {

0 commit comments

Comments
 (0)