feat: add resources page with file management
- 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
This commit is contained in:
@@ -13,6 +13,7 @@ export default defineEventHandler(async (event) => {
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
mimeType: z.string(),
|
||||
size: z.number(),
|
||||
url: z.string(),
|
||||
})
|
||||
.safeParse(body),
|
||||
@@ -24,13 +25,14 @@ export default defineEventHandler(async (event) => {
|
||||
});
|
||||
}
|
||||
|
||||
const { id, name, mimeType, url } = result.data;
|
||||
const { id, name, mimeType, size, url } = result.data;
|
||||
|
||||
const file = await db.insert(files).values({
|
||||
id,
|
||||
userId,
|
||||
name,
|
||||
mimeType,
|
||||
size,
|
||||
url,
|
||||
createdAt: new Date(),
|
||||
}).returning();
|
||||
|
||||
Reference in New Issue
Block a user