mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 10:30:17 +01:00
ajout endpoint POST pour ajout avis
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user