We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e5f4dc0 + 01d5b32 commit 079ed23Copy full SHA for 079ed23
src/routes/notes/trash.ts
@@ -3,6 +3,7 @@ import { HTTPException } from "hono/http-exception";
3
import { db, notes } from "../../db";
4
import { eq, and, count } from "drizzle-orm";
5
import { emptyTrashResponseSchema } from "../../lib/openapi-schemas";
6
+import { deleteCachePattern } from "../../lib/cache";
7
8
const trashRouter = new OpenAPIHono();
9
@@ -44,6 +45,9 @@ trashRouter.openapi(emptyTrashRoute, async (c) => {
44
45
46
await db.delete(notes).where(and(eq(notes.userId, userId), eq(notes.deleted, true)));
47
48
+ // Invalidate all note counts cache for this user (global and all folders)
49
+ await deleteCachePattern(`notes:${userId}:*`);
50
+
51
return c.json(
52
{
53
success: true,
0 commit comments