ajout endpoint POST pour ajout avis

This commit is contained in:
2022-12-24 16:11:40 +01:00
parent 70396e0dc1
commit beb7e26ce7
6 changed files with 38 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
const validSources = ["borne", "website"];
const validSexes = ["h","f"];
const validSexes = ["h","f","a"];
export class Review {
constructor(auteur, note, source, commentaire=null, notesAutre={}) {
@@ -14,7 +14,7 @@ export class Review {
}
for(let nom in notesAutre) {
if(notesAutre[nom] < 0 || notesAutre[nom] > 10) {
throw new Error("Note " + rating +"/10 invalide");
throw new Error("Note " + notesAutre[nom] +"/10 invalide");
}
}
if(!validSources.includes(source)) {