From 92413a29ec2c62fb7174d95378dbe2ec8bff7c8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20L=C3=A1szl=C3=B3?= <rlacko99@gmail.com>
Date: Thu, 22 Oct 2020 20:35:43 +0200
Subject: [PATCH] update gitignore and readme for static files

---
 .gitignore                                     | 2 +-
 README.md                                      | 5 +++++
 src/middlewares/files/profilePictureStorage.ts | 2 +-
 uploads/.gitignore                             | 4 ++++
 uploads/card_images/.gitignore                 | 2 ++
 uploads/profile_picture/.gitkeep               | 0
 uploads/profile_pictures/.gitignore            | 2 ++
 7 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 uploads/.gitignore
 create mode 100644 uploads/card_images/.gitignore
 delete mode 100644 uploads/profile_picture/.gitkeep
 create mode 100644 uploads/profile_pictures/.gitignore

diff --git a/.gitignore b/.gitignore
index 5a044c6c..c2f87a63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -82,4 +82,4 @@ typings/
 build/
 
 # Mongose database
-data/
\ No newline at end of file
+data/
diff --git a/README.md b/README.md
index 4e413363..92c0858e 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,10 @@
 # Schönherz BodyKör webpage backend
 
+## Initial Setup
+
+uploads/card_images and uploads/profile_pictures folder
+needed for file uploads!
+
 ## Recommended Extensions
 
 VSCode:
diff --git a/src/middlewares/files/profilePictureStorage.ts b/src/middlewares/files/profilePictureStorage.ts
index 5f484bcc..2252de35 100644
--- a/src/middlewares/files/profilePictureStorage.ts
+++ b/src/middlewares/files/profilePictureStorage.ts
@@ -3,7 +3,7 @@ import path from "path";
 
 export const profilePictureStorage = multer.diskStorage({
   destination: function (req, file, callback) {
-    callback(null, "uploads/profile_picture/");
+    callback(null, "uploads/profile_pictures/");
   },
   filename: function (req, file, callback) {
     callback(null, Date.now() + "-" + file.originalname);
diff --git a/uploads/.gitignore b/uploads/.gitignore
new file mode 100644
index 00000000..b47774fb
--- /dev/null
+++ b/uploads/.gitignore
@@ -0,0 +1,4 @@
+/*
+!/card_images/
+!/profile_pictures/
+!/.gitignore
\ No newline at end of file
diff --git a/uploads/card_images/.gitignore b/uploads/card_images/.gitignore
new file mode 100644
index 00000000..11b4bb12
--- /dev/null
+++ b/uploads/card_images/.gitignore
@@ -0,0 +1,2 @@
+/*
+!/.gitignore
\ No newline at end of file
diff --git a/uploads/profile_picture/.gitkeep b/uploads/profile_picture/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/uploads/profile_pictures/.gitignore b/uploads/profile_pictures/.gitignore
new file mode 100644
index 00000000..11b4bb12
--- /dev/null
+++ b/uploads/profile_pictures/.gitignore
@@ -0,0 +1,2 @@
+/*
+!/.gitignore
\ No newline at end of file
-- 
GitLab