|
@@ -13,6 +13,8 @@ module.exports = {
|
|
|
type: String (paper/coin)
|
|
type: String (paper/coin)
|
|
|
year: Number
|
|
year: Number
|
|
|
comment: String
|
|
comment: String
|
|
|
|
|
+ name: String
|
|
|
|
|
+ value: Number
|
|
|
}
|
|
}
|
|
|
req.files = {
|
|
req.files = {
|
|
|
frontImage: Image
|
|
frontImage: Image
|
|
@@ -27,7 +29,6 @@ module.exports = {
|
|
|
if(req.body.password !== uploader.password) throw "pass";
|
|
if(req.body.password !== uploader.password) throw "pass";
|
|
|
|
|
|
|
|
let createImage = (image)=>{
|
|
let createImage = (image)=>{
|
|
|
- console.log(image);
|
|
|
|
|
let fileString = `/currencyimages/${createId(25)}.jpg`;
|
|
let fileString = `/currencyimages/${createId(25)}.jpg`;
|
|
|
image.mv(`${__dirname}/..${fileString}`);
|
|
image.mv(`${__dirname}/..${fileString}`);
|
|
|
return fileString;
|
|
return fileString;
|
|
@@ -35,6 +36,8 @@ module.exports = {
|
|
|
|
|
|
|
|
let currency = new Currency({
|
|
let currency = new Currency({
|
|
|
location: req.body.location,
|
|
location: req.body.location,
|
|
|
|
|
+ name: req.body.name,
|
|
|
|
|
+ value: req.body.value,
|
|
|
type: req.body.type,
|
|
type: req.body.type,
|
|
|
year: req.body.year,
|
|
year: req.body.year,
|
|
|
comment: req.body.comment,
|
|
comment: req.body.comment,
|