mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-01-11 16:57:59 -05:00
Round goal distance and elevation values
Backend now rounds total_distance and total_elevation in goal progress calculations. Frontend modal displays rounded goal distance in kilometers. Removed unused ref import from GoalsListComponent.vue.
This commit is contained in:
@@ -75,8 +75,8 @@ def calculate_goal_progress_by_activity_type(
|
||||
percentage_completed=round(percentage_completed),
|
||||
total_calories=total_calories,
|
||||
total_activities_number=total_activities_number,
|
||||
total_distance=total_distance,
|
||||
total_elevation=total_elevation,
|
||||
total_distance=round(total_distance),
|
||||
total_elevation=round(total_elevation),
|
||||
total_duration=total_duration,
|
||||
goal_calories=goal.goal_calories,
|
||||
goal_activities_number=goal.goal_activities_number,
|
||||
|
||||
@@ -277,7 +277,8 @@ import {
|
||||
milesToMeters,
|
||||
kmToMeters,
|
||||
metersToMiles,
|
||||
metersToFeet
|
||||
metersToFeet,
|
||||
metersToKm
|
||||
} from '@/utils/unitsUtils'
|
||||
|
||||
import { userGoals as userGoalsService } from '@/services/userGoalsService'
|
||||
@@ -316,7 +317,7 @@ if (props.goal) {
|
||||
newEditGoalType.value = props.goal.goal_type
|
||||
newEditGoalCalories.value = props.goal.goal_calories
|
||||
newEditGoalActivitiesNumber.value = props.goal.goal_activities_number
|
||||
newEditGoalDistanceMetric.value = props.goal.goal_distance
|
||||
newEditGoalDistanceMetric.value = Math.round(metersToKm(props.goal.goal_distance))
|
||||
newEditGoalDistanceImperial.value = metersToMiles(props.goal.goal_distance)
|
||||
newEditGoalElevationMetric.value = props.goal.goal_elevation
|
||||
newEditGoalElevationImperial.value = metersToFeet(props.goal.goal_elevation)
|
||||
|
||||
@@ -126,7 +126,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useAuthStore } from '@/stores/authStore'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { push } from 'notivue'
|
||||
|
||||
Reference in New Issue
Block a user