diff --git a/apps/envited.ascs.digital/common/ipfs/ipfs.ts b/apps/envited.ascs.digital/common/ipfs/ipfs.ts index bc87b3df..d3938a2b 100644 --- a/apps/envited.ascs.digital/common/ipfs/ipfs.ts +++ b/apps/envited.ascs.digital/common/ipfs/ipfs.ts @@ -24,11 +24,19 @@ export const uploadFile = // }, // }) + if (group) { - return pinata.upload.file(new File([arrayBuffer], filename)).addMetadata({ name: filename }).group(group).then(prop('IpfsHash')) + return pinata.upload + .stream(stream) + .addMetadata({ name: filename }) + .group(group) + .then(prop('IpfsHash')) } - return pinata.upload.file(new File([arrayBuffer], filename)).addMetadata({ name: filename }).then(prop('IpfsHash')) + return pinata.upload + .file(new File([arrayBuffer], filename)) + .addMetadata({ name: filename }) + .then(prop('IpfsHash')) } export const createGroup = (pinata: PinataSDK) => async (groupName: string) => { diff --git a/apps/envited.ascs.digital/stacks/Envited.ts b/apps/envited.ascs.digital/stacks/Envited.ts index 4029f774..e6076819 100644 --- a/apps/envited.ascs.digital/stacks/Envited.ts +++ b/apps/envited.ascs.digital/stacks/Envited.ts @@ -111,6 +111,7 @@ export default function Envited({ stack }: StackContext) { vpc, timeout: 60, memorySize: 1024, + runtime: 'nodejs20.x', }, events: ['object_created_put'], }, @@ -177,6 +178,7 @@ export default function Envited({ stack }: StackContext) { bind: [uploadsBucket, assetsBucket], memorySize: '1024 MB', timeout: '20 seconds', + runtime: 'nodejs20.x', cdk: { server: { vpc,