digital ocean spaces/aws S3 integratoin

This commit is contained in:
Daniel
2023-07-01 17:41:39 +03:30
parent 9cf3b78ba1
commit 04a92dae37
20 changed files with 1330 additions and 78 deletions
@@ -1,6 +1,6 @@
import { prisma } from "@/lib/api/db";
import { CollectionIncludingMembersAndLinkCount } from "@/types/global";
import { existsSync, mkdirSync } from "fs";
import createFolder from "@/lib/api/storage/createFolder";
export default async function postCollection(
collection: CollectionIncludingMembersAndLinkCount,
@@ -66,9 +66,7 @@ export default async function postCollection(
},
});
const collectionPath = `data/archives/${newCollection.id}`;
if (!existsSync(collectionPath))
mkdirSync(collectionPath, { recursive: true });
createFolder({ filePath: `archives/${newCollection.id}` });
return { response: newCollection, status: 200 };
}