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-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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user