diff --git a/client/src/views/trainer/Schedule.vue b/client/src/views/trainer/Schedule.vue index 25185c1..eff7508 100644 --- a/client/src/views/trainer/Schedule.vue +++ b/client/src/views/trainer/Schedule.vue @@ -165,7 +165,6 @@ export default { }, methods: { async addTimeslot(day_of_week: number) { - this.showNewInput[day_of_week - 1] = false const input: NewDayInput = this.newDayInput[day_of_week - 1]; const start_time = `${input.startHour}:${input.startMinute ? input.startMinute : 0}`; const end_time = `${input.endHour}:${input.endMinute ? input.endMinute : 0}`; @@ -185,6 +184,9 @@ export default { if (res.status === 401 || res.status === 403) { this.$router.push({ path: "/login", query: { ref: this.$route.path } }); } + if (res.status === 204) { + this.showNewInput[day_of_week - 1] = false; + } this.fetchSchedule(); },