fix: id resets when modal is closed

This commit is contained in:
Arman
2022-07-04 16:55:25 +02:00
parent fa27262951
commit b99dd0855f
2 changed files with 10 additions and 2 deletions
@@ -15,7 +15,7 @@
const create = async () => {
try {
const team = await sdkForProject.teams.create(id ? id : 'unique()', name);
const team = await sdkForProject.teams.create(id ?? 'unique()', name);
name = '';
showCreate = false;
dispatch('created', team);
@@ -26,6 +26,10 @@
});
}
};
$: if (!showDropdown) {
id = null;
}
</script>
<Form on:submit={create}>
@@ -22,7 +22,7 @@
const create = async () => {
try {
const user = await sdkForProject.users.create(id ? id : 'unique()', mail, pass, name);
const user = await sdkForProject.users.create(id ?? 'unique()', mail, pass, name);
mail = pass = name = '';
showCreate = false;
dispatch('created', user);
@@ -33,6 +33,10 @@
});
}
};
$: if (!showDropdown) {
id = null;
}
</script>
<Form on:submit={create}>