Add post /signup when creating account
This commit is contained in:
parent
c95b335e3c
commit
214f64dd94
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user