modified: serv_nginx/bbvue/src/stores/auth.js
renamed: serv_nginx/bbvue/src/stores/user.js -> serv_nginx/bbvue/src/stores/user_store.js modified: serv_nginx/bbvue/src/views/Members.vue search-input width is corrected
This commit is contained in:
@@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
|
|||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { apiClient, withLoading } from './helpers/api'
|
import { apiClient, withLoading } from './helpers/api'
|
||||||
import { handleApiError } from './helpers/api';
|
import { handleApiError } from './helpers/api';
|
||||||
|
import { userStore } from './user_store'
|
||||||
|
|
||||||
export const useAuthStore = defineStore('auth', () => {
|
export const useAuthStore = defineStore('auth', () => {
|
||||||
// State
|
// State
|
||||||
@@ -68,6 +69,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
const logout = async () => {
|
const logout = async () => {
|
||||||
return withLoading({ loading, error }, async () => {
|
return withLoading({ loading, error }, async () => {
|
||||||
try {
|
try {
|
||||||
|
userStore.resetUserStore()
|
||||||
await apiClient.post('/auth/logout')
|
await apiClient.post('/auth/logout')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Logout error:', err)
|
console.error('Logout error:', err)
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Новые actions для дополнительных данных
|
// Новые actions для дополнительных данных
|
||||||
const fetchPersonalBests = async () => {
|
const fetchPersonalBests = async () => {
|
||||||
return withStoreLoading(async () => {
|
return withStoreLoading(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiClient.get('/user/personal-bests')
|
const response = await apiClient.get('/user/personal-bests')
|
||||||
@@ -160,29 +160,8 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
personalBests.value = response.data
|
personalBests.value = response.data
|
||||||
return { success: true, data: personalBests.value }
|
return { success: true, data: personalBests.value }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn('Personal bests endpoint not available, using mock data', error)
|
console.warn('Personal bests 1endpoint not available, using mock data', error)
|
||||||
personalBests.value = [
|
personalBests.value = []
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
distanceType: '5k',
|
|
||||||
time: '23:45',
|
|
||||||
pace: '4:45',
|
|
||||||
date: '2024-02-15',
|
|
||||||
verified: true,
|
|
||||||
eventName: 'Парковый забег',
|
|
||||||
location: 'Центральный парк'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
distanceType: '10k',
|
|
||||||
time: '48:15',
|
|
||||||
pace: '4:49',
|
|
||||||
date: '2024-03-10',
|
|
||||||
verified: true,
|
|
||||||
eventName: 'Весенний марафон',
|
|
||||||
location: 'Набережная'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
return { success: true, data: personalBests.value }
|
return { success: true, data: personalBests.value }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -847,7 +847,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
width: 100%;
|
width: 80%;
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
border: 2px solid #e9ecef;
|
border: 2px solid #e9ecef;
|
||||||
border-radius: 25px;
|
border-radius: 25px;
|
||||||
|
|||||||
Reference in New Issue
Block a user