Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"sharp": "^0.35.1",
"sonner": "^2.0.7",
"swagger-ui-react": "5.32.6",
"tailwind-merge": "^3.6.0"
"tailwind-merge": "^3.6.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@emnapi/core": "^1.11.0",
Expand Down
72 changes: 72 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions scratch_fix_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import glob

files = glob.glob("src/app/api/milestones/**/route.ts", recursive=True) + glob.glob("src/app/api/tasks/**/route.ts", recursive=True)

for file in files:
with open(file, "r") as f:
content = f.read()

# Replace the session checks
content = content.replace(
"if (!session?.user?.id && !session?.githubId) {\n return new Response(\"Unauthorized\", { status: 401 });\n }",
"if (!session?.githubId) {\n return new Response(\"Unauthorized\", { status: 401 });\n }"
)

# Replace the user id retrieval
content = content.replace(
"const userId = session.user?.id || session.githubId;\n const appUser = await resolveAppUser(userId, session.githubLogin);",
"const appUser = await resolveAppUser(session.githubId, session.githubLogin);"
)

with open(file, "w") as f:
f.write(content)

print("Fixed", file)
21 changes: 21 additions & 0 deletions scratch_fix_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os

filepath = "supabase/schema.sql"
with open(filepath, "r") as f:
lines = f.readlines()

new_lines = []
for line in lines:
if line.startswith("<<<<<<< HEAD"):
continue
elif line.startswith("======="):
continue
elif line.startswith(">>>>>>> upstream/main"):
continue
else:
new_lines.append(line)

with open(filepath, "w") as f:
f.writelines(new_lines)

print("Conflict markers removed from", filepath)
37 changes: 37 additions & 0 deletions scratch_update_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import sys

filepath = "supabase/schema.sql"
with open(filepath, "r") as f:
content = f.read()

old_tasks = """create table if not exists tasks (
id text primary key default gen_random_uuid()::text,
user_id text not null references users(id) on delete cascade,
title text not null,
completed boolean not null default false,
milestone_id text,
created_at timestamptz default now(),
updated_at timestamptz default now()
);"""

new_tasks = """create table if not exists tasks (
id text primary key default gen_random_uuid()::text,
user_id text not null references users(id) on delete cascade,
title text not null,
completed boolean not null default false,
status text not null default 'todo',
priority text not null default 'medium',
due_date timestamptz,
tags text[] not null default '{}'::text[],
milestone_id text,
created_at timestamptz default now(),
updated_at timestamptz default now()
);"""

if old_tasks in content:
content = content.replace(old_tasks, new_tasks)
with open(filepath, "w") as f:
f.write(content)
print("Updated schema.sql successfully")
else:
print("Could not find the target text in schema.sql")
Loading
Loading