Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1647 | Rev 1649 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1647 Rev 1648
Línea 420... Línea 420...
420
            accepts: 'application/json',
420
            accepts: 'application/json',
421
            method: 'GET',
421
            method: 'GET',
422
            data: {
422
            data: {
423
                'email': $('#form-add #email').val(),
423
                'email': $('#form-add #email').val(),
424
            }
424
            }
425
        });
-
 
426
    }).done(function (response) {
425
        }).done(function (response) {
427
        if (response['success']) {
426
            if (response['success']) {
428
            $('#form-add #first_name').val(response['data']['first_name']);
427
                $('#form-add #first_name').val(response['data']['first_name']);
429
            $('#form-add #last_name').val(response['data']['last_name']);
428
                $('#form-add #last_name').val(response['data']['last_name']);
430
        }else {
-
 
431
            validatorAdd.resetForm();
-
 
432
            if (jQuery.type(response['data']) == 'string') {
-
 
433
                $.fn.showError(response['data']);
-
 
434
            } else {
429
            } else {
435
                $.each(response['data'], function (fieldname, errors) {
-
 
436
                    $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
430
                $.fn.showError(response['data']);
437
                });
-
 
438
            }
431
            }
439
        }
-
 
440
        }).fail(function (jqXHR, textStatus, errorThrown) {
432
        }).fail(function (jqXHR, textStatus, errorThrown) {
441
            $.fn.showError(textStatus);
433
            $.fn.showError(textStatus);
442
        }).always(function () {
434
        }).always(function () {
443
            NProgress.done();
435
            NProgress.done();
444
        });
436
        });
-
 
437
    })
445
});
438
});
446
JS;
439
JS;
447
$this->inlineScript()->captureEnd();
440
$this->inlineScript()->captureEnd();
448
?>
441
?>