feat(account): add basic view of an account"

This commit is contained in:
2021-11-23 01:46:39 +01:00
parent d7b1e51016
commit e332d6ab12
6 changed files with 73 additions and 18 deletions

View 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>

View File

@@ -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>

View File

@@ -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)