From 43b6792e304954e60892b820122378e7d0625e1e Mon Sep 17 00:00:00 2001 From: Jake/Rads Date: Fri, 24 Jun 2022 08:11:10 +0200 Subject: [PATCH] fix(dashboard): fix undefined name after creation --- dashboard/src/lib/group/NewGroup.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/src/lib/group/NewGroup.svelte b/dashboard/src/lib/group/NewGroup.svelte index 1aedfa39..0aecda87 100644 --- a/dashboard/src/lib/group/NewGroup.svelte +++ b/dashboard/src/lib/group/NewGroup.svelte @@ -26,8 +26,8 @@ const dispatch = createEventDispatcher(); - function create() { - dispatch('create', input); + function create(data: Group) { + dispatch('create', data); } let input: Group = JSON.parse(JSON.stringify(defaultGroup)); @@ -51,10 +51,10 @@ loading = true; try { let res = await api().groups().post({data}); + create(res); input = JSON.parse(JSON.stringify(defaultGroup)); - err = []; - create(); message = `Group ${data.name} successfully created!` + err = []; loading = false; } catch (error) { console.log(error);