sajjad_talkhabi 3 years ago
parent e9c71d46dd
commit c0acb7b839

@ -67,6 +67,7 @@
</template> </template>
<script> <script>
import { mapActions, mapMutations } from "vuex"; import { mapActions, mapMutations } from "vuex";
import { UserStorage } from "@/utils/storage";
export default { export default {
props: { props: {
series: { series: {

@ -20,7 +20,10 @@
label="manager image" label="manager image"
:url.sync="form.thumbnail" :url.sync="form.thumbnail"
v-model="fileForm" v-model="fileForm"
:stencilProps="{ aspectRatio: 1280 / 720, checkImageOrigin: false }" :stencilProps="{
aspectRatio: 1280 / 720,
checkImageOrigin: false,
}"
/> />
</div> </div>
</div> </div>
@ -191,7 +194,7 @@ export default {
fileForm: { fileForm: {
batch_id: RANDOM_TOKEN, batch_id: RANDOM_TOKEN,
collection: "main_image", collection: "main_image",
crop_data: {} crop_data: {},
}, },
}), }),
computed: { computed: {
@ -218,12 +221,13 @@ export default {
try { try {
let repository = new FileRepository(); let repository = new FileRepository();
if (this.workoutId) { if (this.workoutId) {
if (this.fileForm.file if (
// || !_.isEqual(this.fileForm.crop_data, this.perviousCropData) this.fileForm.file
) { // || !_.isEqual(this.fileForm.crop_data, this.perviousCropData)
) {
await repository.store(this.fileForm); await repository.store(this.fileForm);
} }
await this.updateWorkout(this.form); await this.updateWorkout(this.form);
this.$router.push({ name: "workouts" }); this.$router.push({ name: "workouts" });
} else { } else {
await repository.store(this.fileForm); await repository.store(this.fileForm);

@ -4,7 +4,7 @@
transition="slide-x-transition" transition="slide-x-transition"
tag="form" tag="form"
@submit="WorkoutToSeries" @submit="WorkoutToSeries"
@open="openModal" @close="closeModal"
> >
<template #header> <template #header>
<div class="close__modal"> <div class="close__modal">
@ -44,7 +44,14 @@
class="mt-3" class="mt-3"
/> --> /> -->
<div class="pb-3 align mt-2"> <div class="pb-3 align mt-2">
<div class="series__workout__title wa__f__m__eb text-uppercase mb-2"> <div
class="
series__workout__title
wa__f__m__eb
text-uppercase
mb-2
"
>
{{ item.name }} {{ item.name }}
</div> </div>
<div class="series__workout__description"> <div class="series__workout__description">
@ -176,9 +183,14 @@ export default {
}, },
}, },
methods: { methods: {
...mapActions("workoutToSeries", ["loadWorkoutsToSeries", "addWorkoutToSeries"]), ...mapActions("workoutToSeries", [
"loadWorkoutsToSeries",
"addWorkoutToSeries",
]),
...mapMutations("workoutToSeries", ["SET_FILTER_WORKOUTS_TO_SERIES"]), ...mapMutations("workoutToSeries", ["SET_FILTER_WORKOUTS_TO_SERIES"]),
openModal() {}, closeModal() {
this.SET_FILTER_WORKOUTS_TO_SERIES({});
},
async joinWorkout(id) { async joinWorkout(id) {
this.workoutId = id; this.workoutId = id;
let repository = new WorkoutToSeriesRepository(); let repository = new WorkoutToSeriesRepository();
@ -200,7 +212,7 @@ export default {
}, },
async created() { async created() {
// this.SET_FILTER_WORKOUTS_TO_SERIES({ // this.SET_FILTER_WORKOUTS_TO_SERIES({
// }); // });
await this.loadWorkoutsToSeries(); await this.loadWorkoutsToSeries();
console.log(this.getWorkoutsToSeries); console.log(this.getWorkoutsToSeries);
@ -228,4 +240,4 @@ export default {
.align { .align {
line-height: 4px; line-height: 4px;
} }
</style> </style>
Loading…
Cancel
Save