Skip to content

Commit 6aec1a1

Browse files
committed
fix: simplified path
1 parent 8e74a46 commit 6aec1a1

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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)