mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: files get added to uploader on upload
This commit is contained in:
1 parent
9f47508b44
commit
97a72d5d7e
1 file changed
+9
-1
@@ -5,6 +5,7 @@
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { page } from '$app/stores';
|
||||
import { uploader } from '$lib/stores/uploader';
|
||||
|
||||
export let showCreate = false;
|
||||
|
||||
@@ -17,9 +18,16 @@
|
||||
|
||||
const create = async () => {
|
||||
try {
|
||||
await sdkForProject.storage.createFile(bucket, 'unique()', files[0], read, write);
|
||||
const file = await sdkForProject.storage.createFile(
|
||||
bucket,
|
||||
'unique()',
|
||||
files[0],
|
||||
read,
|
||||
write
|
||||
);
|
||||
files = null;
|
||||
showCreate = false;
|
||||
uploader.addFile(file);
|
||||
dispatch('created');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
Reference in new issue
Block a user