feat: basic recent file browsing

This commit is contained in:
2025-10-28 20:26:12 +00:00
parent 7fe5184e81
commit a8c7a8f60b
9 changed files with 109 additions and 7 deletions

View File

@@ -265,3 +265,19 @@ export async function openFile(
shareToken: newFileShare.shareToken,
}
}
export async function fetchRecentFiles(
ctx: AuthenticatedQueryCtx,
{ limit }: { limit: number },
) {
return await ctx.db
.query("files")
.withIndex("byLastAccessedAt", (q) =>
q
.eq("userId", ctx.user._id)
.eq("deletedAt", undefined)
.gte("lastAccessedAt", 0),
)
.order("desc")
.take(limit)
}