Browse Source

:beers: Add a forgotten file from previous commit

master
Clement Desmidt 6 months ago
parent
commit
f6c9947f3c
1 changed files with 41 additions and 4 deletions
  1. 41
    4
      public/js/app.js

+ 41
- 4
public/js/app.js View File

@@ -48937,6 +48937,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
48937 48937
 //
48938 48938
 //
48939 48939
 //
48940
+//
48940 48941
 
48941 48942
 /* harmony default export */ __webpack_exports__["default"] = ({
48942 48943
     name: 'registration',
@@ -48947,6 +48948,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
48947 48948
             loading: false,
48948 48949
             success: false,
48949 48950
             error: false,
48951
+            resend: false,
48950 48952
             message: ''
48951 48953
         };
48952 48954
     },
@@ -48970,16 +48972,29 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
48970 48972
                 } else {
48971 48973
                     _this.message = 'An error occurred: ' + response.statusText;
48972 48974
                 }
48975
+                if (409 === response.status) {
48976
+                    _this.resend = true;
48977
+                }
48978
+            });
48979
+        },
48980
+        resendAction: function resendAction() {
48981
+            var _this2 = this;
48982
+
48983
+            this.resetMessages();
48984
+            this.loading = true;
48985
+            var formData = new FormData();
48986
+            formData.append('email', this.email);
48987
+            Vue.http.post('api/resend', formData, { emulateJSON: false }).then(function (response) {
48988
+                _this2.loading = false;
48989
+                _this2.success = true;
48990
+                _this2.message = 'An email has been sent.';
48973 48991
             });
48974 48992
         },
48975 48993
         resetMessages: function resetMessages() {
48976 48994
             this.success = false;
48977 48995
             this.error = false;
48996
+            this.resend = false;
48978 48997
         }
48979
-    },
48980
-    mounted: function mounted() {
48981
-        console.log('Component mounted.');
48982
-        this.resource = this.$resource('api/register');
48983 48998
     }
48984 48999
 });
48985 49000
 
@@ -49083,6 +49098,28 @@ var render = function() {
49083 49098
               attrs: { role: "alert" }
49084 49099
             },
49085 49100
             [_vm._v(_vm._s(_vm.message))]
49101
+          ),
49102
+          _vm._v(" "),
49103
+          _c(
49104
+            "button",
49105
+            {
49106
+              directives: [
49107
+                {
49108
+                  name: "show",
49109
+                  rawName: "v-show",
49110
+                  value: _vm.resend,
49111
+                  expression: "resend"
49112
+                }
49113
+              ],
49114
+              staticClass: "btn btn-primary btn-lg",
49115
+              attrs: { type: "submit" },
49116
+              on: {
49117
+                click: function($event) {
49118
+                  _vm.resendAction()
49119
+                }
49120
+              }
49121
+            },
49122
+            [_vm._v("Resend link")]
49086 49123
           )
49087 49124
         ])
49088 49125
       : _vm._e()

Loading…
Cancel
Save