cognee/cognee-frontend/src/modules/exploration/getExplorationGraphUrl.ts
Boris e1a0b55a21
feat: user authentication in routes (#133)
* feat: require logged in user in routes
2024-09-08 21:12:49 +02:00

13 lines
440 B
TypeScript

import { fetch } from '@/utils';
export default function getExplorationGraphUrl(dataset: { id: string }) {
return fetch(`/v1/datasets/${dataset.id}/graph`)
.then(async (response) => {
if (response.status !== 200) {
throw new Error((await response.text()).replaceAll("\"", ""));
}
return response;
})
.then((response) => response.text())
.then((text) => text.replace('"', ''));
}