|
1 | 1 | import { zValidator } from "@hono/zod-validator"; |
2 | 2 | import { randomUUIDv7 } from "bun"; |
| 3 | +import { MESSAGE_MAX_LENGTH, type Message } from "common/zod/schema.ts"; |
3 | 4 | import { stringify } from "devalue"; |
4 | 5 | import { Hono } from "hono"; |
| 6 | +import { HTTPException } from "hono/http-exception"; |
5 | 7 | import { streamSSE } from "hono/streaming"; |
6 | 8 | import z from "zod"; |
7 | | -import { prisma } from "../config/prisma.ts"; |
8 | | - |
9 | | -import { MESSAGE_MAX_LENGTH, type Message } from "common/zod/schema.ts"; |
10 | | -import { HTTPException } from "hono/http-exception"; |
11 | 9 | import { getUserID } from "../auth/func.ts"; |
| 10 | +import { prisma } from "../config/prisma.ts"; |
12 | 11 | import { onMessageSend } from "../email/hooks/onMessageSend.ts"; |
| 12 | + |
13 | 13 | const router = new Hono() |
14 | 14 | // # general paths |
15 | 15 | // ## about room |
@@ -62,7 +62,7 @@ const router = new Hono() |
62 | 62 | data: c.req.valid("json"), |
63 | 63 | }); |
64 | 64 | return c.json({ ok: true }, 200); |
65 | | - } catch (err) { |
| 65 | + } catch (_err) { |
66 | 66 | return c.json({ error: "room not found" }, 404); |
67 | 67 | } |
68 | 68 | }, |
@@ -123,7 +123,7 @@ const router = new Hono() |
123 | 123 | }, |
124 | 124 | }); |
125 | 125 | return c.json({ ok: true }, 200); |
126 | | - } catch (err) { |
| 126 | + } catch (_err) { |
127 | 127 | return c.json({ error: "member not found" }, 404); |
128 | 128 | } |
129 | 129 | }, |
@@ -471,7 +471,7 @@ const router = new Hono() |
471 | 471 | data: { content: json.content, isEdited: true }, |
472 | 472 | select: { roomId: true }, |
473 | 473 | }); |
474 | | - } catch (err) { |
| 474 | + } catch (_err) { |
475 | 475 | return c.json({ error: "previous message not found" }, 404); |
476 | 476 | } |
477 | 477 |
|
@@ -516,7 +516,7 @@ const router = new Hono() |
516 | 516 | where: { id: messageId, senderId: requester, roomId: room }, |
517 | 517 | select: { roomId: true }, |
518 | 518 | }); |
519 | | - } catch (err) { |
| 519 | + } catch (_err) { |
520 | 520 | return c.json({ error: "previous message not found" }, 404); |
521 | 521 | } |
522 | 522 |
|
|
0 commit comments