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-form>
</b-card>
<b-card class="mt-3" header="Form Data Result">
<pre class="m-0">{{ form }}</pre>
</b-card>
</div>
</template>
<script>
import Api from '@/api'
export default {
name: "SignupForm",
data() {
@ -98,8 +96,15 @@
methods: {
handleSubmit() {
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))
}
}
}