aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/components
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-04-10 00:11:59 -0700
committerDhravya <[email protected]>2024-04-10 00:11:59 -0700
commit338e4f378c0752e298f2a2021feda953830ddd02 (patch)
tree534747073b32c7ec3d6ae8b54a2bf65c79b8bf87 /apps/web/src/components
parentremoved all pnpm-lock files (diff)
downloadsupermemory-338e4f378c0752e298f2a2021feda953830ddd02.tar.xz
supermemory-338e4f378c0752e298f2a2021feda953830ddd02.zip
spaces in the API
Diffstat (limited to 'apps/web/src/components')
-rw-r--r--apps/web/src/components/Main.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/web/src/components/Main.tsx b/apps/web/src/components/Main.tsx
index 3d0fc18a..4e0392c9 100644
--- a/apps/web/src/components/Main.tsx
+++ b/apps/web/src/components/Main.tsx
@@ -37,6 +37,8 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) {
const textArea = useRef<HTMLDivElement>(null);
const main = useRef<HTMLDivElement>(null);
+ const [selectedSpaces, setSelectedSpaces] = useState<string[]>([]);
+
useEffect(() => {
const search = searchParams.get('q');
if (search && search.trim().length > 0) {
@@ -182,7 +184,7 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) {
ids: string[];
};
- setIsAiLoading(false)
+ setIsAiLoading(false);
setChatHistory((prev) => {
const lastMessage = prev[prev.length - 1];
return [
@@ -197,8 +199,7 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) {
];
});
- // TODO: PASS THE `SPACE` TO THE API
- const response = await fetch(`/api/chat?q=${_value}`, {
+ const response = await fetch(`/api/chat?q=${_value}&spaces=${selectedSpaces.join(",")}`, {
method: 'POST',
body: JSON.stringify({
chatHistory: modifyChatHistory(chatHistory),