diff --git a/api/letters.js b/api/letters.js index 433abfd6..80c5d5f7 100644 --- a/api/letters.js +++ b/api/letters.js @@ -34,6 +34,13 @@ export default async function handler(req, res) { } } else if (req.method === "POST") { const { text, signature, handle } = req.body + + if (text.length > 100) { + res.statusCode = 400 + res.end() + return + } + try { const newLetter = await push(ref(database, "letters")) await set(newLetter, { diff --git a/interface/sections/Letters.tsx b/interface/sections/Letters.tsx index 0f188904..3fc672c2 100644 --- a/interface/sections/Letters.tsx +++ b/interface/sections/Letters.tsx @@ -293,6 +293,7 @@ function SendLetter(props: { ? setLetterWritten(true) : setLetterWritten(false) }} + maxLength={100} class="w-full h-full bg-zinc-100 px-4 py-3 resize-none rounded-xl transition-all outline-transparent focus:outline-4 focus:outline-zinc-500/10 focus:border-zinc-300 outline-offset-1 border border-zinc-200 dark:bg-zinc-800 dark:border-zinc-700 dark:placeholder:text-zinc-500 dark:focus:border-zinc-600 dark:focus:outline-none" >