diff --git a/docker-compose.yml b/docker-compose.yml index fa9ac46b..c5b2d228 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -112,6 +112,7 @@ services: - 'DEEPLINKS_HASURA_SSL=${DEEPLINKS_HASURA_SSL}' - 'DEEPLINKS_HASURA_SECRET=${DEEPLINKS_HASURA_SECRET}' - 'JWT_SECRET=${DEEP_HASURA_GRAPHQL_JWT_SECRET}' + - 'DEEPLINKS_HASURA_STORAGE_URL=${DEEPLINKS_HASURA_STORAGE_URL}' logging: driver: "json-file" options: diff --git a/imports/client.tsx b/imports/client.tsx index 3f62aa0d..9cde8dd6 100644 --- a/imports/client.tsx +++ b/imports/client.tsx @@ -1453,8 +1453,9 @@ export class DeepClient = Link> implements DeepClientInst return { ...q, data: (q)?.data?.m0?.returning, error: e }; } if (file) { - if (!toApply?.[0]?.id) throw new Error('Cannot insert file without link'); - await upload(toApply[0].id, file, this); + const id = (q)?.data?.m0?.returning?.[0]?.id; + if (!id) throw new Error('Cannot insert file without link'); + await upload(id, file, this); }; } else { this.emitter.emit('insert', { deep: this, name: _name, value: objects, options, remoteQuery: mutate, file, remote, local }); diff --git a/package.json b/package.json index 346ecfd4..ea0b0d71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deep-foundation/deeplinks", - "version": "0.0.531", + "version": "0.0.532", "license": "Unlicense", "type": "module", "main": "import.js",