[store] Add new added types to store

This commit is contained in:
Ferdinand Thiessen 2021-05-25 17:27:13 +02:00
parent b6cfaf8c4b
commit 2d4b1a1aef
1 changed files with 7 additions and 2 deletions

View File

@ -42,8 +42,13 @@ export const useScheduleStore = defineStore({
},
async addJobType(name: string) {
await api.post<FG.JobType>('/events/job-types', { name: name });
//TODO: HAndle new JT
try {
const { data } = await api.post<FG.JobType>('/events/job-types', { name: name });
this.jobTypes.push(data)
} catch (error) {
// TODO: HANDLE ERROR
throw error
}
},
async removeJobType(id: number) {