Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 561 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 561 Rev 591
Línea 35... Línea 35...
35
                    backendVars.STATUS_COMPLETED :
35
                    backendVars.STATUS_COMPLETED :
36
                backendVars.STATUS_DRAFT);
36
                backendVars.STATUS_DRAFT);
Línea 37... Línea 37...
37
 
37
 
38
        // check if the form has at least one response
38
        // check if the form has at least one response
39
        if (leastOneAnswer()) {
39
        if (leastOneAnswer()) {
40
            await axios.post(action, formData).then((response) =>
40
            await axios.post(action, formData).then((response) => {
-
 
41
                if (response.data.success) {
41
                response.data.success && formCompleted() ?
42
                    formCompleted() ?
42
                    setSuccess(true) :
43
                        setSuccess(true) :
43
                    setDraft(true)
-
 
-
 
44
                        setDraft(true)
44
 
45
                }
45
            )
46
            })
46
        } else {
47
        } else {
47
            setError(true);
48
            setError(true);
Línea 91... Línea 92...
91
     */
92
     */
92
    const formPending = () => {
93
    const formPending = () => {
93
        let pending = false;
94
        let pending = false;
94
        test.content.map((section) => {
95
        test.content.map((section) => {
95
            section.questions.map((question) => {
96
            section.questions.map((question) => {
96
                if (question.type == "open" || question.type == "rating-open"  || question.type == "rating-range" ) {
97
                if (question.type == "open" || question.type == "rating-open" || question.type == "rating-range") {
97
                    pending = true;
98
                    pending = true;
98
                }
99
                }
99
            });
100
            });
100
        })
101
        })
101
        return pending;
102
        return pending;