From f8b8e1e437b0a12d1f9c9e8dbe4369fc888b3bba Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 29 Sep 2021 19:27:18 +0200 Subject: [PATCH] debug --- packages/ipfs-api/src/server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ipfs-api/src/server.ts b/packages/ipfs-api/src/server.ts index 4b18048b..6fedf94d 100644 --- a/packages/ipfs-api/src/server.ts +++ b/packages/ipfs-api/src/server.ts @@ -62,15 +62,15 @@ async function handleGetLink( const record = await recordsDB.findOne({ cid }); - console.log(record); - if (record && record.skylink) { res.status(200).send({ skylink: record.skylink }); return; } // insert an empty record for the cid - await recordsDB.insertOne({ cid, createdAt: new Date(), skylink: "" }); + if (!record) { + await recordsDB.insertOne({ cid, createdAt: new Date(), skylink: "" }); + } // reupload the cid and return the skylink const skylink = await reuploadFile(cid, recordsDB);