{"action":"opened","issue":{"url":"https://api.github.com/repos/t4t5/sweetalert/issues/589","repository_url":"https://api.github.com/repos/t4t5/sweetalert","labels_url":"https://api.github.com/repos/t4t5/sweetalert/issues/589/labels{/name}","comments_url":"https://api.github.com/repos/t4t5/sweetalert/issues/589/comments","events_url":"https://api.github.com/repos/t4t5/sweetalert/issues/589/events","html_url":"https://github.com/t4t5/sweetalert/issues/589","id":160724680,"number":589,"title":"Html content does not change after each ajax request.","user":{"login":"franc014","id":8205018,"avatar_url":"https://avatars.githubusercontent.com/u/8205018?v=3","gravatar_id":"","url":"https://api.github.com/users/franc014","html_url":"https://github.com/franc014","followers_url":"https://api.github.com/users/franc014/followers","following_url":"https://api.github.com/users/franc014/following{/other_user}","gists_url":"https://api.github.com/users/franc014/gists{/gist_id}","starred_url":"https://api.github.com/users/franc014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franc014/subscriptions","organizations_url":"https://api.github.com/users/franc014/orgs","repos_url":"https://api.github.com/users/franc014/repos","events_url":"https://api.github.com/users/franc014/events{/privacy}","received_events_url":"https://api.github.com/users/franc014/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-16T18:09:01Z","updated_at":"2016-06-16T18:09:01Z","closed_at":null,"body":"Hi, \r\nI'm working in a Vue.js application. I'm using Vue Resource to consume API data generated in a PHP backend. When validation errors occur, i receive those errors in the error call back, which are iterated, formatted and passed to the \"text\" option of the Sweet Alert Object. Whenever each error is fixed by the user, He again submits the form and a new ajax call is made. The call back now registers an array with errors, but obviously omitting  the last one fixed. The response from the server is Ok, however, Sweet Alert continues showing the same error data, from the previous call, including the fixed error. This is the code from the ajax call and the Sweet Alert Use:\r\n\r\n```\r\nhttp.post(server + 'lead', this.infoform).then(function (response) {\r\n                                var sweetAlert = sweet_alert;\r\n                                sweetAlert(\"Envío exitoso\", \"Hemos receptado tu requerimiento. Pronto estaremos en contacto!\", \"success\");\r\n                                this.clearContactForm();\r\n\r\n                            }, function (response) {\r\n                                var sweetAlert = sweet_alert;\r\n\r\n                                var body = [];\r\n                                var error_code = response.data.result.code;\r\n                                var alert_errors = \"\";\r\n                                switch (error_code) {\r\n                                    case 400:\r\n                                        var errors = response.data.result.errors;\r\n                                        body.push('<ul class=\"list-group\">');\r\n                                        errors.forEach(function (i, k, a) {\r\n                                            body.push('<li class=\"list-group-item list-group-item-danger\">' + i + '</li>');\r\n                                        })\r\n                                        body.push('</ul>');\r\n                                     \r\n                                        alert_errors = body.join('\\n');\r\n                                        var message_heading = \"<h1>Lo sentimos :(</h1><p>Los siguientes errores deben ser corregidos antes de enviar tu solicitud:</p>\";\r\n                                        sweetAlert(\r\n                                            {\r\n                                                title: message_heading,\r\n                                                text:  alert_errors,\r\n                                                html: true,\r\n                                                type: \"error\"\r\n                                            });\r\n                                        break;\r\n                                    default:\r\n                                        var message_heading = \"<h1>Lo sentimos :(</h1><p>Estamos presentando problemas en nuestro servicio. Intenta nuevamente por favor, o contacta a Maresa via email o teléfono para ofrecerte atención personalizada:</p>\";\r\n                                        sweetAlert(\r\n                                            {\r\n                                                title: message_heading,\r\n                                                text: alert_errors,\r\n                                                html: true,\r\n                                                type: \"error\"\r\n                                            });\r\n                                        break;\r\n\r\n                                }\r\n\r\n                                //console.log(alert_errors);\r\n\r\n                            });\r\n\r\n```\r\nIs there any way to reset the alert to show only the new response errors at each new call?\r\nSorry for the length from this message, but any help is welcome.\r\nThanks for your time.\r\n\r\n\r\n\r\n "}}
{"actor":{"display_login":"franc014"}}