a0f2e89154
- Add /resources page with file listing, filtering, and bulk operations - Add useResources composable for file state management - Add sidenav header and nav components for resources section - Add files list API endpoint (GET /api/files) - Track file size during upload - Add resources link to home navigation
18 lines
369 B
TypeScript
18 lines
369 B
TypeScript
import { db } from "~~/server/lib/db";
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
await protectRoute(event);
|
|
const userId = event.context.user!.id as string;
|
|
|
|
const result = await db.query.files.findMany({
|
|
where: {
|
|
userId,
|
|
},
|
|
orderBy: {
|
|
createdAt: 'desc',
|
|
}
|
|
});
|
|
|
|
return result;
|
|
});
|