aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-11 16:37:22 +0200
committerMateja <mail@matejamaric.com>2021-07-11 16:37:22 +0200
commit54619e571698a89727fa1112290addcf2f8c82da (patch)
tree86c5174a448c0b6a76d92d26e2ef7715f40c4129 /server
parent8e9922bd920814caea4670226fa8cbac2a040373 (diff)
downloadmevn-ecommerce-54619e571698a89727fa1112290addcf2f8c82da.tar.gz
mevn-ecommerce-54619e571698a89727fa1112290addcf2f8c82da.zip
Add default image for products.
Diffstat (limited to 'server')
-rw-r--r--server/models/Product.js2
-rw-r--r--server/uploads/no-image.pngbin0 -> 25570 bytes
2 files changed, 1 insertions, 1 deletions
diff --git a/server/models/Product.js b/server/models/Product.js
index f825a8b..a8ef10e 100644
--- a/server/models/Product.js
+++ b/server/models/Product.js
@@ -12,7 +12,7 @@ const ProductSchema = new mongoose.Schema({
},
imagePath: {
type: String,
- required: false,
+ default: "uploads/no-image.png",
maxLength: [256, "Product's image path can't have more then 256 characters."]
},
price: {
diff --git a/server/uploads/no-image.png b/server/uploads/no-image.png
new file mode 100644
index 0000000..4c91643
--- /dev/null
+++ b/server/uploads/no-image.png
Binary files differ