TEST UPD
- try to fix bug of sum points
This commit is contained in:
@@ -84,14 +84,15 @@ const energyPoints = createResource({
|
||||
order_by: 'creation desc',
|
||||
limit_page_length: 1000
|
||||
},
|
||||
auto: true,
|
||||
auto: false,
|
||||
onSuccess(data) {
|
||||
console.log('Баллы загружены:', data.length, 'записей')
|
||||
}
|
||||
})
|
||||
|
||||
const totalPoints = computed(() => {
|
||||
return energyPoints.data?.reduce((sum, item) => sum + (item.points || 0), 0) || 0
|
||||
const list = Array.isArray(energyPoints.data) ? energyPoints.data : []
|
||||
return list.reduce((sum, item) => sum + (item.points || 0), 0)
|
||||
})
|
||||
|
||||
const additionalPoints = computed(() => {
|
||||
@@ -100,7 +101,7 @@ const additionalPoints = computed(() => {
|
||||
})
|
||||
|
||||
const breadcrumbs = computed(() => [
|
||||
{ label: 'Главная', route: '/app' },
|
||||
{ label: 'Главная', route: '/' },
|
||||
{ label: 'Мои баллы' }
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user