Add post /signup when creating account

This commit is contained in:
Hubert Van De Walle 2020-04-12 15:56:37 +02:00
parent c95b335e3c
commit 214f64dd94

View File

@ -61,14 +61,12 @@
<b-button type="submit" variant="primary">Submit</b-button> <b-button type="submit" variant="primary">Submit</b-button>
</b-form> </b-form>
</b-card> </b-card>
<b-card class="mt-3" header="Form Data Result">
<pre class="m-0">{{ form }}</pre>
</b-card>
</div> </div>
</template> </template>
<script> <script>
import Api from '@/api'
export default { export default {
name: "SignupForm", name: "SignupForm",
data() { data() {
@ -98,8 +96,15 @@
methods: { methods: {
handleSubmit() { handleSubmit() {
if (this.validInput) { if (this.validInput) {
console.log("Valid") this.signup()
} }
},
signup() {
Api.post('/signup', {
username: this.form.username,
email: this.form.email,
password: this.form.password
}).then(response => console.log(response.data))
} }
} }
} }