1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-14 14:42:55 +01:00

Update attachments.ts

This commit is contained in:
Flam3rboy 2021-05-28 12:22:19 +02:00 committed by GitHub
parent 4e69d83457
commit 9352b965d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ router.post("/:channel_id", multer_.single("attachment"), async (req, res) => {
const { buffer, mimetype, stream, size, originalname, fieldname } = req.file; const { buffer, mimetype, stream, size, originalname, fieldname } = req.file;
const { channel_id } = req.params; const { channel_id } = req.params;
const filename = originalname.replaceAll(" ", "_").replace(/\W+/g, ""); const filename = originalname.replaceAll(" ", "_").replace(/\W+/g, "");
t;
const endpoint = Config.get().cdn.endpoint || "http://localhost:3003"; const endpoint = Config.get().cdn.endpoint || "http://localhost:3003";
await storage.set(originalname, buffer); await storage.set(originalname, buffer);