diff --git a/resources/js/composables/content/models/show/showDays.ts b/resources/js/composables/content/models/show/showDays.ts index 2b3073d..fd06a7f 100644 --- a/resources/js/composables/content/models/show/showDays.ts +++ b/resources/js/composables/content/models/show/showDays.ts @@ -1,7 +1,5 @@ -import { VSelect, VTextField } from "vuetify/components"; -import type {Show} from "@models/show/show"; import axios, {type AxiosResponse} from "axios"; -import {dateFormatter} from "@/helpers/DateFormatter.ts"; +import {cleanOptions} from "@/helpers/AxiosHelper.ts"; export interface ShowDays { id?: number; @@ -20,7 +18,7 @@ export interface ShowDays { export const baseShowDays = ():ShowDays => { return { firstShow: new Date(), - lastShow: new Date(), + lastShow: null, startTime: '08:00', timezone: '', duration: '01:00', @@ -36,9 +34,8 @@ export const getShowDays = async (options: { showId?: number | null; flattenShowDays?: boolean; }): Promise => { - const filteredParams = Object.fromEntries( - Object.entries(options).filter(([_, value]) => value !== undefined && value !== null) - ); + const filteredParams = cleanOptions(options); + return await axios.get(`/showDays`, {params: filteredParams}) .then((response: AxiosResponse) => { return response.data