update homepage draft and other pages
This commit is contained in:
20
src/routes/projects/progress/topics/+page.server.ts
Normal file
20
src/routes/projects/progress/topics/+page.server.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { db } from '$lib/db';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const topics = await db.query.topics.findMany({
|
||||
with: {
|
||||
topicsToTasks: {
|
||||
with: {
|
||||
task: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
topics.sort((a, b) => b.topicsToTasks.length - a.topicsToTasks.length);
|
||||
|
||||
return {
|
||||
topics
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user