sintonia_webapp/resources/js/stores/showInstance.store.ts

27 lines
No EOL
848 B
TypeScript

import { defineStore } from 'pinia'
import { type Show } from '@models/show/show'
import type {ShowDays} from "@models/show/showDays";
import {baseShowInstance, type ShowInstance} from "@models/show/showInstance.ts";
export const useShowInstanceStore = defineStore('showInstance', {
state: () => ({
currentShowInstance: {} as ShowInstance
}),
actions: {
loadShowInstance(showInstanceData: ShowInstance) {
this.currentShowInstance = { ...showInstanceData }
},
updateField(payload: { key: string; value: any }) {
this.currentShowInstance[payload.key] = payload.value
},
resetShowInstance() {
this.currentShowInstance = baseShowInstance()
},
async saveShowInstance() {
},
async updateShowInstance() {
},
}
})