fix my account creation
This commit is contained in:
@@ -26,12 +26,12 @@
|
||||
</b-tab>
|
||||
</b-tabs>
|
||||
</b-card>
|
||||
<b-modal ref="my-modal" size="lg" centered title="">
|
||||
<b-modal ref="create-account" size="lg" centered title="">
|
||||
<template #modal-header="{ }">
|
||||
<h5>Ajout d'un compte</h5>
|
||||
</template>
|
||||
<template #modal-footer="{ ok, cancel }">
|
||||
<b-button size="sm" variant="success" @click="ok()">
|
||||
<b-button size="sm" variant="success" @click="validateForm()">
|
||||
Créer
|
||||
</b-button>
|
||||
<b-button size="sm" variant="danger" @click="cancel()">
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
<script>
|
||||
import {BCard, BTabs, BTab, BCardText, BCardTitle, BIconPlusCircleFill, BModal, BFormGroup, BFormSelect, BFormInput} from "bootstrap-vue";
|
||||
import {getAccounts} from "@/config/noscomptes";
|
||||
import {createAccount, getAccounts} from "@/config/noscomptes";
|
||||
export default {
|
||||
name: 'mes_comptes',
|
||||
data: function () {
|
||||
@@ -89,8 +89,13 @@ export default {
|
||||
mounted () {
|
||||
},
|
||||
methods: {
|
||||
validateForm() {
|
||||
let loggedUser = this.$store.state.loggedUser
|
||||
createAccount(loggedUser.oauth_token, loggedUser.nosComptesId, {"name": this.name, "provider": this.provider})
|
||||
.then(this.$refs['create-account'].hide())
|
||||
},
|
||||
show() {
|
||||
this.$refs['my-modal'].show()
|
||||
this.$refs['create-account'].show()
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -25,7 +25,7 @@ export const createAccount = (oauthToken, userId, account) => {
|
||||
const headers = {
|
||||
"Authorization": "Bearer " + oauthToken
|
||||
};
|
||||
return Vue.axios.post("http://localhost:8081/configuration", account, {headers}).then(response => {
|
||||
return Vue.axios.post("http://localhost:8081/users/"+userId+"/accounts", account, {headers}).then(response => {
|
||||
console.log(response);
|
||||
return response.data
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user