From 2d4b1a1aef703a18e373d6227268f502e9f7fc8b Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 25 May 2021 17:27:13 +0200 Subject: [PATCH] [store] Add new added types to store --- src/store.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/store.ts b/src/store.ts index 1d74b50..166f625 100644 --- a/src/store.ts +++ b/src/store.ts @@ -42,8 +42,13 @@ export const useScheduleStore = defineStore({ }, async addJobType(name: string) { - await api.post('/events/job-types', { name: name }); - //TODO: HAndle new JT + try { + const { data } = await api.post('/events/job-types', { name: name }); + this.jobTypes.push(data) + } catch (error) { + // TODO: HANDLE ERROR + throw error + } }, async removeJobType(id: number) {