Skip to content

Commit 5c0aa1d

Browse files
committed
Merge branch 'feat(web)/update-upload-to-ipfs-function' of github.com:kleros/kleros-v2 into feat(web)/update-upload-to-ipfs-function
2 parents 742f016 + 6aec1a1 commit 5c0aa1d

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

.github/workflows/contracts-testing.yml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
nodejs.org:443
3030
objects.githubusercontent.com:443
3131
registry.yarnpkg.com:443
32+
registry.npmjs.org:443
3233
3334
- name: Setup Node.js environment
3435
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c

web/netlify/functions/uploadToIPFS.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,13 @@ const parseMultipart = ({ headers, body, isBase64Encoded }) =>
5050
bb.end();
5151
});
5252

53-
const pinToFilebase = async (data: FormData, dapp: string, operation: string) => {
54-
const today = new Date();
55-
const year = today.getFullYear();
56-
const month = today.getMonth() + 1; // getMonth() is zero-based
57-
const day = today.getDate();
53+
const pinToFilebase = async (data: FormData, dapp: string, operation: string): Promise<Array<string>> => {
5854
const cids = new Array<string>();
59-
6055
for (const [_, dataElement] of Object.entries(data)) {
6156
if (dataElement.isFile) {
6257
const { filename, mimeType, content } = dataElement;
63-
const path = `/${dapp}/${year}/${month}/${day}/${filename}`;
64-
// await filebase.put(path, content);
65-
58+
const path = `${filename}`;
6659
const cid = await filebase.storeDirectory([new File([content], path, { type: mimeType })]);
67-
6860
await emitRabbitMQLog(cid, operation);
6961
cids.push(cid);
7062
}

0 commit comments

Comments
 (0)