Skip to content

Commit

Permalink
Merge pull request #1145 from appwrite/fix-collection-creation-error-…
Browse files Browse the repository at this point in the history
…notification

fix: collection creation hidden errors  notification
  • Loading branch information
TorstenDittmann authored Jun 13, 2024
2 parents 9a9136b + fb44326 commit be60a89
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
let name = '';
let id: string = null;
let showCustomId = true;
let error: string;
const create = async () => {
error = null;
try {
const collection = await sdk.forProject.databases.createCollection(
databaseId,
Expand All @@ -36,17 +38,21 @@
trackEvent(Submit.CollectionCreate, {
customId: !!id
});
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.CollectionCreate);
} catch (e) {
error = e.message;
trackError(e, Submit.CollectionCreate);
}
};
$: if (!showCreate) {
error = null;
showCustomId = false;
id = null;
name = '';
}
</script>

<Modal title="Create collection" size="big" bind:show={showCreate} onSubmit={create}>
<Modal title="Create collection" size="big" bind:show={showCreate} onSubmit={create} bind:error>
<FormList>
<InputText
id="name"
Expand Down

0 comments on commit be60a89

Please sign in to comment.