fix: build errors and merging projects and homepage

This commit is contained in:
2026-08-30 21:38:59 +00:00
parent 97ff9852cd
commit c9a7294d13
71 changed files with 10942 additions and 5413 deletions

View File

@@ -1,6 +1,4 @@
import { db } from '$lib/db';
import { tasks } from '$lib/db/schema.js';
import { desc } from 'drizzle-orm';
import { db } from '$lib/server/db';
export const load = async () => {
return {
@@ -12,7 +10,9 @@ export const load = async () => {
}
}
},
orderBy: [desc(tasks.currentPoints)]
orderBy: {
currentPoints: 'desc'
}
})
};
};

View File

@@ -1,5 +1,5 @@
import { db } from '$lib/db';
import { tasks, tasksToTopics, topics } from '$lib/db/schema';
import { db } from '$lib/server/db';
import { tasks, tasksToTopics, topics } from '$lib/server/db/schema';
import { eq, and } from 'drizzle-orm';
export const load = async ({ cookies, params }) => {
@@ -12,7 +12,9 @@ export const load = async ({ cookies, params }) => {
}
}
},
where: eq(tasks.id, params.id)
where: {
id: Number(params.id)
}
}),
topics: await db.query.topics.findMany(),
editable: cookies.get('token')

View File

@@ -1,6 +1,6 @@
import { db } from "$lib/db"
import { tasks } from "$lib/db/schema"
import { redirect } from "@sveltejs/kit"
import { db } from '$lib/server/db';
import { tasks } from '$lib/server/db/schema';
import { redirect } from '@sveltejs/kit';
export const actions = {
default: async ({ cookies, request }) => {
@@ -8,10 +8,13 @@ export const actions = {
return { status: 401 };
}
const data = await request.formData()
const data = await request.formData();
const task = await db.insert(tasks).values({ name: data.get('name') }).returning()
const task = await db
.insert(tasks)
.values({ name: data.get('name') })
.returning();
redirect(303, '/progress/' + task[0].id)
redirect(303, '/progress/' + task[0].id);
}
}
};

View File

@@ -1,4 +1,4 @@
import { db } from '$lib/db';
import { db } from '$lib/server/db';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async () => {

View File

@@ -1,6 +1,4 @@
import { db } from '$lib/db';
import { topics } from '$lib/db/schema';
import { eq } from 'drizzle-orm';
import { db } from '$lib/server/db';
export const load = async ({ params }) => {
return {
@@ -12,7 +10,9 @@ export const load = async ({ params }) => {
}
}
},
where: eq(topics.id, params.id)
where: {
id: Number(params.id)
}
})
};
};