Update Back-end connection & fonction Front-end

This commit is contained in:
PascalMarchesseault
2024-06-09 23:02:19 -04:00
parent bc07a0a3b5
commit 24ecff0d59
2 changed files with 4 additions and 20 deletions

View File

@@ -44,7 +44,7 @@
</v-list-item>
<v-list-item v-if="currentUser">
<v-btn @click="handleLogout" class="full-width-btn" flat>Déconnecter</v-btn>
<v-btn @click="logout" class="full-width-btn" flat>Déconnecter</v-btn>
</v-list-item>
</v-list>
</v-menu>
@@ -97,7 +97,7 @@
<v-list-item v-if="currentUser" @click="openWalletDialog" prepend-icon="mdi-wallet" title="Bourse"
value="wallet"></v-list-item>
<v-list-item v-if="currentUser" @click="handleLogout" style="margin-top: 110%;" prepend-icon="mdi-logout"
<v-list-item v-if="currentUser" @click="logout" style="margin-top: 110%;" prepend-icon="mdi-logout"
title="Déconnecter" value="logout"></v-list-item>
</v-list>
</v-navigation-drawer>
@@ -191,14 +191,6 @@ function logout() {
localStorage.removeItem('jwt');
currentUser = null;
currentUserName.value = "INVITÉ";
}
function handleLogout() {
logout();
Reroot();
}
function Reroot() {
router.push('/');
}

View File

@@ -1,7 +1,7 @@
<template>
<DefaultLayout style="margin-bottom: 30px"></DefaultLayout>
<!--
<!-- Router Info and user informations
<v-container style="margin-top: -1%; margin-bottom: 2%;">
<v-row>
<v-col align="center">
@@ -246,9 +246,6 @@
</v-col>
</v-row>
</div>
</v-col>
@@ -322,7 +319,6 @@ import StripePayment from '../views/StripePayment.vue';
const PublicCreatorData = ref(null);
const selectedUsername = ref('');
const manualUsername = ref('');
const route = useRoute();
const client = useClient();
@@ -348,7 +344,7 @@ let navigationItems = [
const fetchUser = async (username) => {
console.log(`Fetching user: ${username}`);
try {
const response = await client.get(`/api/GetCreatorInfo`, {
const response = await client.get(`/api/Users`, {
params: {
UserName: username
}
@@ -382,10 +378,6 @@ const updateUser = () => {
}
};
const manualFetch = () => {
fetchUser(manualUsername.value);
};
onMounted(updateUser);
watch(() => route.params.username, updateUser);