mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
organize auth apis
This commit is contained in:
parent
54d29c6064
commit
c8fae413d2
2 changed files with 76 additions and 0 deletions
|
|
@ -89,3 +89,24 @@ export const fetchSearchSpace = async (searchSpaceId: string) => {
|
|||
|
||||
return await response.json();
|
||||
};
|
||||
|
||||
export const fetchSearchSpacePreferences = async (
|
||||
searchSpaceId: number,
|
||||
authToken: string
|
||||
) => {
|
||||
const response = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/search-spaces/${searchSpaceId}/llm-preferences`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${authToken}`,
|
||||
},
|
||||
method: "GET",
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch LLM preferences");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue