Client - minor fixes

This commit is contained in:
Sam 2022-08-27 19:23:01 +02:00
parent 59940ed41d
commit 9ed142e100
4 changed files with 11 additions and 5 deletions

View File

@ -66,7 +66,7 @@
function getQuery(
page: number,
cursor?: number
): TWorkoutsPayload | TPaginationPayload {
): TPaginationPayload | IOauth2ClientsPayload {
const newQuery = Object.assign({}, query.value)
newQuery.page = cursor ? page + cursor : page
return newQuery

View File

@ -28,13 +28,13 @@
import SportsMenu from '@/components/Statistics/StatsSportsMenu.vue'
import { ISport, ITranslatedSport } from '@/types/sports'
import { IStatisticsDateParams } from '@/types/statistics'
import { IUserProfile } from '@/types/user'
import { IAuthUserProfile } from '@/types/user'
import { translateSports } from '@/utils/sports'
import { getStatsDateParams, updateChartParams } from '@/utils/statistics'
interface Props {
sports: ISport[]
user: IUserProfile
user: IAuthUserProfile
}
const props = defineProps<Props>()

View File

@ -184,7 +184,8 @@
const { t } = useI18n()
const { isEdition, user } = toRefs(props)
const sportColors = inject('sportColors')
const defaultColor = '#838383'
const sportColors: Record<string, string> | undefined = inject('sportColors')
const sports: ComputedRef<ISport[]> = computed(
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
)
@ -207,7 +208,11 @@
function updateSportInEdition(sport: ISport | null) {
if (sport !== null) {
sportPayload.sport_id = sport.id
sportPayload.color = sport.color ? sport.color : sportColors[sport.label]
sportPayload.color = sport.color
? sport.color
: sportColors
? sportColors[sport.label]
: defaultColor
sportPayload.is_active = sport.is_active_for_user
sportPayload.stopped_speed_threshold = sport.stopped_speed_threshold
} else {

View File

@ -18,6 +18,7 @@ export interface IUserProfile {
picture: string | boolean
records: IRecord[]
sports_list: number[]
total_ascent: number
total_distance: number
total_duration: string
username: string