mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1145 from appwrite/fix-collection-creation-error-notification
fix: collection creation hidden errors notification
This commit is contained in:
+13
-7
@@ -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,
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user