debug
This commit is contained in:
parent
a6f428db82
commit
f8b8e1e437
|
@ -62,15 +62,15 @@ async function handleGetLink(
|
||||||
|
|
||||||
const record = await recordsDB.findOne({ cid });
|
const record = await recordsDB.findOne({ cid });
|
||||||
|
|
||||||
console.log(record);
|
|
||||||
|
|
||||||
if (record && record.skylink) {
|
if (record && record.skylink) {
|
||||||
res.status(200).send({ skylink: record.skylink });
|
res.status(200).send({ skylink: record.skylink });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert an empty record for the cid
|
// insert an empty record for the cid
|
||||||
|
if (!record) {
|
||||||
await recordsDB.insertOne({ cid, createdAt: new Date(), skylink: "" });
|
await recordsDB.insertOne({ cid, createdAt: new Date(), skylink: "" });
|
||||||
|
}
|
||||||
|
|
||||||
// reupload the cid and return the skylink
|
// reupload the cid and return the skylink
|
||||||
const skylink = await reuploadFile(cid, recordsDB);
|
const skylink = await reuploadFile(cid, recordsDB);
|
||||||
|
|
Reference in New Issue