Client - update filters on sports
This commit is contained in:
parent
e4434acc94
commit
b695d665d2
@ -45,7 +45,7 @@
|
||||
v-model="workoutDataObject.sport_id"
|
||||
>
|
||||
<option
|
||||
v-for="sport in translatedSports"
|
||||
v-for="sport in translatedSports.filter((s) => s.is_active)"
|
||||
:value="sport.id"
|
||||
:key="sport.id"
|
||||
>
|
||||
|
@ -19,7 +19,9 @@
|
||||
<select name="sport_id" @change="handleFilterChange">
|
||||
<option value="" />
|
||||
<option
|
||||
v-for="sport in translatedSports"
|
||||
v-for="sport in translatedSports.filter((s) =>
|
||||
authUser.sports_list.includes(s.id)
|
||||
)"
|
||||
:value="sport.id"
|
||||
:key="sport.id"
|
||||
>
|
||||
@ -137,11 +139,16 @@
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { ISport } from '@/types/sports'
|
||||
import { IAuthUserProfile } from '@/types/user'
|
||||
import { translateSports } from '@/utils/sports'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'WorkoutsFilters',
|
||||
props: {
|
||||
authUser: {
|
||||
type: Object as PropType<IAuthUserProfile>,
|
||||
required: true,
|
||||
},
|
||||
sports: {
|
||||
type: Object as PropType<ISport[]>,
|
||||
required: true,
|
||||
|
@ -2,7 +2,11 @@
|
||||
<div id="workouts" v-if="authUser.username">
|
||||
<div class="container workouts-container">
|
||||
<div class="filters-container" :class="{ hidden: hiddenFilters }">
|
||||
<WorkoutsFilters :sports="translatedSports" @filter="updateParams" />
|
||||
<WorkoutsFilters
|
||||
:sports="translatedSports"
|
||||
:authUser="authUser"
|
||||
@filter="updateParams"
|
||||
/>
|
||||
</div>
|
||||
<div class="display-filters">
|
||||
<div @click="toggleFilters">
|
||||
|
Loading…
Reference in New Issue
Block a user