fix(dashboard): fix crash when searching after member creation

This commit is contained in:
Jake/Rads 2022-06-24 08:10:11 +02:00
parent 30f3dcf031
commit f84f7eacdd

View File

@ -38,8 +38,8 @@
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
function create() { function create(data: Member) {
dispatch('create', input); dispatch('create', data);
} }
async function submit() { async function submit() {
@ -89,11 +89,10 @@
loading = true; loading = true;
try { try {
let res = await api().members().post({data}); let res = await api().members().post({data});
input = res; create(res);
err = []; input = JSON.parse(JSON.stringify(defaultMember));
create();
input = JSON.parse(JSON.stringify(defaultMember));;
message = `Member ${data.name} successfully created!` message = `Member ${data.name} successfully created!`
err = [];
loading = false; loading = false;
} catch (error) { } catch (error) {
console.log(error); console.log(error);