Feat/import export (#136)

* added import/export functionality
This commit is contained in:
Daniel
2023-08-10 12:16:44 -04:00
committed by GitHub
parent 159075b38b
commit d008c441b7
16 changed files with 352 additions and 93 deletions
+4 -4
View File
@@ -31,10 +31,10 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
.status(401)
.json({ response: "You don't have access to this collection." });
const { file, contentType } = await readFile({
filePath: `archives/${collectionId}/${linkId}`,
});
res.setHeader("Content-Type", contentType).status(200);
const { file, contentType, status } = await readFile(
`archives/${collectionId}/${linkId}`
);
res.setHeader("Content-Type", contentType).status(status as number);
return res.send(file);
}