Client - minor fix

This commit is contained in:
Sam 2022-06-22 15:44:50 +02:00
parent af364c39f6
commit c39d6b4137

View File

@ -182,7 +182,7 @@
import { WORKOUTS_STORE } from '@/store/constants'
import { IPagination } from '@/types/api'
import { ITranslatedSport } from '@/types/sports'
import { IUserProfile } from '@/types/user'
import { IAuthUserProfile } from '@/types/user'
import { IWorkout, TWorkoutsPayload } from '@/types/workouts'
import { useStore } from '@/use/useStore'
import { getQuery, sortList, workoutsPayloadKeys } from '@/utils/api'
@ -192,7 +192,7 @@
import { defaultOrder } from '@/utils/workouts'
interface Props {
user: IUserProfile
user: IAuthUserProfile
sports: ITranslatedSport[]
}
const props = defineProps<Props>()
@ -258,7 +258,7 @@
...payload,
}
Object.entries(convertedPayload).map((entry) => {
if (entry[0].match('speed|distance')) {
if (entry[0].match('speed|distance') && entry[1]) {
convertedPayload[entry[0]] = convertDistance(+entry[1], 'mi', 'km')
}
})