gestion plusieurs commentaires par 1 utilisateur

Si un utilisateur post plusieurs commentaires l'utilisateur est ajouté qu'une fois a la bdd
This commit is contained in:
2023-01-03 22:28:57 +01:00
parent e94bf213c2
commit 66d1aaf027
4 changed files with 32 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ export class ReseauxReview extends Review{
super(auteur,note,source,commentaire);
this.lien = lien;
this.date = date;
if(!(lien instanceof String && lien != null)) {
if((typeof lien !== "string" && lien != null)) {
throw new Error("Lien invalide");
}
}
@@ -32,7 +32,7 @@ export class ReseauxAuteur {
this.source = source;
this.lien = lien;
if(!(this.nom instanceof String) || !(this.source instanceof String) || !(this.lien instanceof String)) {
if((typeof this.nom !== "string") || (typeof this.source !== "string")){
throw new Error("Auteur invalide");
}
}