Skip to content

Commit

Permalink
filtre les messages de retour utilisateur
Browse files Browse the repository at this point in the history
  • Loading branch information
mquandalle committed Aug 22, 2024
1 parent eac4ee5 commit f2da7d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routes/api/post-feedback/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit f2da7d7

Please sign in to comment.