Wine models now have extra year field.
This commit is contained in:
@@ -13,6 +13,7 @@ const addWines = wines => {
|
||||
name: wine.name,
|
||||
vivinoLink: wine.vivinoLink,
|
||||
rating: wine.rating,
|
||||
year: wine.year,
|
||||
image: wine.image,
|
||||
price: wine.price,
|
||||
country: wine.country,
|
||||
@@ -44,6 +45,7 @@ const updateWineById = (id, updateModel) => {
|
||||
name: updateModel.name != null ? updateModel.name : wine.name,
|
||||
vivinoLink: updateModel.vivinoLink != null ? updateModel.vivinoLink : wine.vivinoLink,
|
||||
rating: updateModel.rating != null ? updateModel.rating : wine.rating,
|
||||
year: updateModel.year != null ? updateModel.year : wine.year,
|
||||
image: updateModel.image != null ? updateModel.image : wine.image,
|
||||
price: updateModel.price != null ? updateModel.price : wine.price,
|
||||
country: updateModel.country != null ? updateModel.country : wine.country,
|
||||
|
||||
@@ -6,6 +6,7 @@ const PreLotteryWine = new Schema({
|
||||
vivinoLink: String,
|
||||
rating: Number,
|
||||
id: String,
|
||||
year: Number,
|
||||
image: String,
|
||||
price: String,
|
||||
country: String
|
||||
|
||||
@@ -7,6 +7,7 @@ const Wine = new Schema({
|
||||
rating: Number,
|
||||
occurences: Number,
|
||||
id: String,
|
||||
year: Number,
|
||||
image: String,
|
||||
price: String,
|
||||
country: String
|
||||
|
||||
@@ -10,6 +10,7 @@ const convertToOurWineObject = wine => {
|
||||
rating: wine.basic.alcoholContent,
|
||||
occurences: 0,
|
||||
id: wine.basic.productId,
|
||||
year: wine.basic.vintage,
|
||||
image: `https://bilder.vinmonopolet.no/cache/500x500-0/${wine.basic.productId}-1.jpg`,
|
||||
price: wine.prices[0].salesPrice.toString(),
|
||||
country: wine.origins.origin.country
|
||||
|
||||
Reference in New Issue
Block a user