diff --git a/src/routes/api/post-feedback/+server.js b/src/routes/api/post-feedback/+server.js index bd40494..479a63a 100644 --- a/src/routes/api/post-feedback/+server.js +++ b/src/routes/api/post-feedback/+server.js @@ -18,6 +18,10 @@ export async function POST({ request }) { return new Response(undefined, { status: 500 }); } + if (message.length < 5) { + return new Response('Le message doit contenir au moins 5 caractères', { status: 400 }); + } + const res = await fetch('https://api.github.com/repos/mquandalle/mesaidesvelo-feedback/issues', { method: 'POST', headers: {