feat(account): add basic view of an account"
This commit is contained in:
51
src/components/Account.vue
Normal file
51
src/components/Account.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="account-tab">
|
||||
<b-card no-body>
|
||||
<b-tabs card>
|
||||
<b-tab :title=account.name >
|
||||
</b-tab>
|
||||
</b-tabs>
|
||||
</b-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {BCard, BTabs , BTab} from "bootstrap-vue";
|
||||
import {getAnAccount} from "@/config/noscomptes";
|
||||
export default {
|
||||
name: 'account',
|
||||
data: function () {
|
||||
return {
|
||||
account: {},
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
let loggedUser = this.$store.state.loggedUser
|
||||
getAnAccount(loggedUser.oauth_token, loggedUser.nosComptesId, this.$route.params.accountId).then(data => {
|
||||
this.account = data
|
||||
})
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
methods: {
|
||||
loadAccount() {
|
||||
let loggedUser = this.$store.state.loggedUser
|
||||
getAnAccount(loggedUser.oauth_token, loggedUser.nosComptesId, this.$route.params.accountId).then(data => {
|
||||
this.account = data
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
components: {
|
||||
BCard,
|
||||
BTabs,
|
||||
BTab
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<b-card-text>
|
||||
{{account.name}}
|
||||
</b-card-text>
|
||||
<b-button href="#" variant="primary" class="see-account" >Voir</b-button>
|
||||
<b-button :href="'/account/'+account.id" variant="primary" class="see-account" >Voir</b-button>
|
||||
<b-button href="#" variant="danger" v-on:click="validateDeleteAccount(account.id)">Supprimer</b-button>
|
||||
|
||||
</b-card>
|
||||
|
||||
@@ -20,11 +20,12 @@ export default {
|
||||
.signIn()
|
||||
.then(GoogleUser => {
|
||||
return logWithGoogle(GoogleUser.getAuthResponse().id_token).then(data => {
|
||||
console.log( GoogleUser.getBasicProfile())
|
||||
let userInfoMapped = {
|
||||
nosComptesId: data.id,
|
||||
googleId: GoogleUser.wa,
|
||||
firstName: GoogleUser.mt.Re,
|
||||
email: data.email,
|
||||
googleId: GoogleUser.getBasicProfile().getId(),
|
||||
firstName: GoogleUser.getBasicProfile().getGivenName(),
|
||||
email: GoogleUser.getBasicProfile().getEmail(),
|
||||
oauth_token: GoogleUser.getAuthResponse().id_token,
|
||||
}
|
||||
this.$store.commit('setLoginUser', userInfoMapped)
|
||||
|
||||
Reference in New Issue
Block a user