Skip to content
Snippets Groups Projects
Commit f8f334f6 authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Issue #36: FIX redirect user to an empty page

parent fbef2daa
No related branches found
No related tags found
1 merge request!42Issue #36: FIX redirect user to an empty page
...@@ -76,8 +76,12 @@ function CardForm(props) { ...@@ -76,8 +76,12 @@ function CardForm(props) {
const handleAnswer = () => { const handleAnswer = () => {
//redirecionar para /answer/props.id //redirecionar para /answer/props.id
let path = `/form/${props.id}`; if (props.numberOfAnswers) {
history.push(path); let path = `/form/${props.id}`;
history.push(path);
} else {
alert("Não há respostas nesse form.");
}
}; };
const handleVisualize = () => { const handleVisualize = () => {
......
...@@ -123,6 +123,7 @@ function GetForm() { ...@@ -123,6 +123,7 @@ function GetForm() {
.then(function(res) { .then(function(res) {
if (!res.data.length) { if (!res.data.length) {
alert("Não há respostas!"); alert("Não há respostas!");
setToLogin(true);
return; return;
} }
setFormArray(res.data); setFormArray(res.data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment