diff --git a/src/routes/api/get_files.ts b/src/routes/api/workspace/index.ts
similarity index 100%
rename from src/routes/api/get_files.ts
rename to src/routes/api/workspace/index.ts
diff --git a/src/routes/api/files.ts b/src/routes/api/workspace/upload.ts
similarity index 67%
rename from src/routes/api/files.ts
rename to src/routes/api/workspace/upload.ts
index 456d763..35845e4 100644
--- a/src/routes/api/files.ts
+++ b/src/routes/api/workspace/upload.ts
@@ -1,6 +1,4 @@
import { type APIEvent, json, redirect } from "solid-start"
-import { supabase, getUserProfile } from "@/supabase/server";
-import type { UserProfile } from "@/types/api";
export const PUT = () => {
const url = new URL(`/functions/v1/upload-file`, import.meta.env.VITE_SUPABASE_PROJECT_URL as string)
diff --git a/src/routes/dashboard/(overview).tsx b/src/routes/dashboard/(overview).tsx
index 91d4e5f..d7a6452 100644
--- a/src/routes/dashboard/(overview).tsx
+++ b/src/routes/dashboard/(overview).tsx
@@ -53,7 +53,7 @@ const Page: Component = () => {
createEffect(on(currentWorkspaceId, async (workspaceId: string) => {
const response = await fetch(
- `/api/get_files?workspace_id=${currentWorkspaceId()}`,
+ `/api/workspace?workspace_id=${currentWorkspaceId()}`,
{
method: "GET",
headers: { authorization: auth.profile!.api_token },
@@ -87,8 +87,6 @@ const Page: Component = () => {
else {
return
}
-
- return "yeeet";
}
createEffect(() => {
diff --git a/src/utils/files.tsx b/src/utils/files.tsx
index 046fc05..a86cd1a 100644
--- a/src/utils/files.tsx
+++ b/src/utils/files.tsx
@@ -54,7 +54,7 @@ export const makeFileUpload = async (files: FileList | Array, options?: {
headers.authorization = auth.profile.api_token;
}
- const response = await fetch("/api/files", {
+ const response = await fetch("/api/workspace/upload", {
method: "PUT",
headers,
body
diff --git a/vercel.json b/vercel.json
index 6ef7c71..0739d59 100644
--- a/vercel.json
+++ b/vercel.json
@@ -2,7 +2,7 @@
"$schema": "https://openapi.vercel.sh/vercel.json",
"redirects": [
{
- "source": "/api/files",
+ "source": "/api/workspace",
"destination": "https://kcpxeoxkmblpivpgwdsm.supabase.co/functions/v1/upload-file",
"permanent": true
}