many changes across the app

This commit is contained in:
Daniel
2023-05-01 13:37:01 +03:30
parent c1d1d4a4a2
commit 0d0e53218f
14 changed files with 215 additions and 55 deletions
@@ -33,7 +33,13 @@ export default async function (collection: { id: number }, userId: number) {
},
});
fs.rmdirSync(`data/archives/${collection.id}`, { recursive: true });
try {
fs.rmdirSync(`data/archives/${collection.id}`, { recursive: true });
} catch (error) {
console.log(
"Collection's archive directory wasn't deleted most likely because it didn't exist..."
);
}
return await prisma.collection.delete({
where: {