mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-11-10 05:34:44 +00:00
Merge pull request #80 from cse110-fa22-group29/req-stars-fix
Req stars fix
This commit is contained in:
commit
5a05741e08
@ -71,18 +71,22 @@ function initFormHandler() {
|
|||||||
reviewObject["mealImg"] = imgDataURL;
|
reviewObject["mealImg"] = imgDataURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reviewObject["tags"] = [];
|
if(reviewObject["rating"] != null){
|
||||||
|
reviewObject["tags"] = [];
|
||||||
|
|
||||||
let tags = document.querySelectorAll(".tag");
|
let tags = document.querySelectorAll(".tag");
|
||||||
for(let i = 0; i < tags.length; i ++) {
|
for(let i = 0; i < tags.length; i ++) {
|
||||||
reviewObject["tags"].push(tags[i].innerHTML);
|
reviewObject["tags"].push(tags[i].innerHTML);
|
||||||
tagContainer.removeChild(tags[i]);
|
tagContainer.removeChild(tags[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
let nextReviewId = newReviewToStorage(reviewObject);
|
||||||
|
sessionStorage.setItem("currID", JSON.stringify(nextReviewId));
|
||||||
|
|
||||||
|
window.location.assign("./ReviewDetails.html");
|
||||||
|
} else{
|
||||||
|
window.alert("NO! FILL IN STARS");
|
||||||
}
|
}
|
||||||
|
|
||||||
let nextReviewId = newReviewToStorage(reviewObject);
|
|
||||||
sessionStorage.setItem("currID", JSON.stringify(nextReviewId));
|
|
||||||
|
|
||||||
window.location.assign("./ReviewDetails.html");
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user