[store] Add new added types to store
This commit is contained in:
parent
b6cfaf8c4b
commit
2d4b1a1aef
|
@ -42,8 +42,13 @@ export const useScheduleStore = defineStore({
|
||||||
},
|
},
|
||||||
|
|
||||||
async addJobType(name: string) {
|
async addJobType(name: string) {
|
||||||
await api.post<FG.JobType>('/events/job-types', { name: name });
|
try {
|
||||||
//TODO: HAndle new JT
|
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) {
|
async removeJobType(id: number) {
|
||||||
|
|
Loading…
Reference in New Issue