WIP Functionality to request wines for next lottery #24
@@ -1,6 +1,4 @@
|
|||||||
|
|
|||||||
const express = require("express");
|
|
||||||
|
Remove Remove
Remove Remove
fixed fixed
fixed fixed
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
// const router = express.Router();
|
|
||||||
|
Remove Remove
Remove Remove
fixed fixed
fixed fixed
|
|||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
mongoose.connect("mongodb://localhost:27017/vinlottis", {
|
mongoose.connect("mongodb://localhost:27017/vinlottis", {
|
||||||
useNewUrlParser: true
|
useNewUrlParser: true
|
||||||
|
|||||||
|
Remove Remove
Remove Remove
Remove Remove
Remove Remove
fixed fixed
fixed fixed
fixed fixed
fixed fixed
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
|
Is this used? Is this used?
Is this used? Is this used?
fixed fixed
fixed fixed
|
|||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
|
Change to 500x500 Change to 500x500
Refactor this document to reflect changes to backend route setup. TODO:
Refactor this document to reflect changes to backend route setup.
TODO:
- Define this endpoint in `/api/router.js` (e.g. `/wineinfo/search`).
- Change this to be a named anonymous function.
- Export this function at bottom of doc. (e.g. `module.exports = { NAME_OF_FUNCTION, NAME_OF_FUNCTION_2, ... }
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const config = require(path.join(__dirname + "/../config/env/lottery.config"));
|
const config = require(path.join(__dirname + "/../config/env/lottery.config"));
|
||||||
const mustBeAuthenticated = require(path.join(__dirname + "/../middleware/mustBeAuthenticated"))
|
|
||||||
|
Is this used? Is this used?
fixed fixed
|
|||||||
|
|
||||||
const convertToOurWineObject = wine => {
|
const convertToOurWineObject = wine => {
|
||||||
if(wine.basic.ageLimit === "18"){
|
if(wine.basic.ageLimit === "18"){
|
||||||
|
|||||||
|
Is this used? Is this used?
Is this used? Is this used?
fixed fixed
fixed fixed
|
|||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
|
This is in the template which is scoped to This is in the template which is scoped to `this` so we can write: `wines == undefined`. Also the length of a list will not be less that zero so change check to be `wines.length == 0`.
This is in the template which is scoped to This is in the template which is scoped to `this` so we can write: `wines == undefined`. Also the length of a list will not be less that zero so change check to be `wines.length == 0`.
Shorthand would be Shorthand would be `this.wines = await allRequestedWines() || [];`
Shorthand would be Shorthand would be `this.wines = await allRequestedWines() || [];`
Could the item deleted be sent up here and we filter it away instead of making a new request? Could the item deleted be sent up here and we filter it away instead of making a new request?
Could the item deleted be sent up here and we filter it away instead of making a new request? Could the item deleted be sent up here and we filter it away instead of making a new request?
fixed fixed
fixed fixed
fixed fixed
fixed fixed
fixed fixed
fixed fixed
```suggestion
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```
```suggestion
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```
fixed fixed
fixed fixed
|
|||||||
this.wines = this.wines.filter(item => item.wine._id !== wine._id)
|
this.wines = this.wines.filter(item => item.wine._id !== wine._id)
|
||||||
},
|
},
|
||||||
async refreshData(){
|
async refreshData(){
|
||||||
[this.wines, this.isAdmin] = await allRequestedWines() || []
|
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
|
||||||
|
This is in the template which is scoped to This is in the template which is scoped to `this` so we can write: `wines == undefined`. Also the length of a list will not be less that zero so change check to be `wines.length == 0`.
Shorthand would be Shorthand would be `this.wines = await allRequestedWines() || [];`
Could the item deleted be sent up here and we filter it away instead of making a new request? Could the item deleted be sent up here and we filter it away instead of making a new request?
fixed fixed
fixed fixed
fixed fixed
```suggestion
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```
fixed fixed
This is in the template which is scoped to This is in the template which is scoped to `this` so we can write: `wines == undefined`. Also the length of a list will not be less that zero so change check to be `wines.length == 0`.
Shorthand would be Shorthand would be `this.wines = await allRequestedWines() || [];`
Could the item deleted be sent up here and we filter it away instead of making a new request? Could the item deleted be sent up here and we filter it away instead of making a new request?
fixed fixed
fixed fixed
fixed fixed
```suggestion
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```
fixed fixed
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
|
This is in the template which is scoped to This is in the template which is scoped to `this` so we can write: `wines == undefined`. Also the length of a list will not be less that zero so change check to be `wines.length == 0`.
This is in the template which is scoped to This is in the template which is scoped to `this` so we can write: `wines == undefined`. Also the length of a list will not be less that zero so change check to be `wines.length == 0`.
Shorthand would be Shorthand would be `this.wines = await allRequestedWines() || [];`
Shorthand would be Shorthand would be `this.wines = await allRequestedWines() || [];`
Could the item deleted be sent up here and we filter it away instead of making a new request? Could the item deleted be sent up here and we filter it away instead of making a new request?
Could the item deleted be sent up here and we filter it away instead of making a new request? Could the item deleted be sent up here and we filter it away instead of making a new request?
fixed fixed
fixed fixed
fixed fixed
fixed fixed
fixed fixed
fixed fixed
```suggestion
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```
```suggestion
[this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```
fixed fixed
fixed fixed
|
|||||||
Remove
Remove
Remove
Remove
fixed
fixed
fixed
fixed