Skip to content

Commit 079ed23

Browse files
authored
Merge pull request #8 from typelets/feat/diagram-notes-support
feat: add code note type and migrate to Upstash Redis + Piston
2 parents e5f4dc0 + 01d5b32 commit 079ed23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/routes/notes/trash.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { HTTPException } from "hono/http-exception";
33
import { db, notes } from "../../db";
44
import { eq, and, count } from "drizzle-orm";
55
import { emptyTrashResponseSchema } from "../../lib/openapi-schemas";
6+
import { deleteCachePattern } from "../../lib/cache";
67

78
const trashRouter = new OpenAPIHono();
89

@@ -44,6 +45,9 @@ trashRouter.openapi(emptyTrashRoute, async (c) => {
4445

4546
await db.delete(notes).where(and(eq(notes.userId, userId), eq(notes.deleted, true)));
4647

48+
// Invalidate all note counts cache for this user (global and all folders)
49+
await deleteCachePattern(`notes:${userId}:*`);
50+
4751
return c.json(
4852
{
4953
success: true,

0 commit comments

Comments
 (0)