WIP Functionality to request wines for next lottery #24

Merged
Adrianht merged 23 commits from feat/request-wine into master 2020-09-07 14:28:31 +00:00
4 changed files with 48 additions and 6 deletions
Showing only changes of commit a5ae46f5c3 - Show all commits

View File

@@ -9,11 +9,18 @@ const RequestedWine = require(path.join(
const Wine = require(path.join( const Wine = require(path.join(
__dirname + "/../schemas/Wine" __dirname + "/../schemas/Wine"
)); ));
const mustBeAuthenticated = require(path.join(
__dirname + "/../middleware/mustBeAuthenticated"
));
router.use((req, res, next) => { router.use((req, res, next) => {
next(); next();
}); });
router.route("/request/").delete(mustBeAuthenticated, async (req, res) => {
await RequestedWine.deleteOne({wineId: req.body.id})
res.json(true);
})
router.route("/request").get(async (req, res) => { router.route("/request").get(async (req, res) => {
const rWines = await RequestedWine.find({}).populate("wine") const rWines = await RequestedWine.find({}).populate("wine")

View File

@@ -100,6 +100,21 @@ const winners = () => {
return fetch(url.href).then(resp => resp.json()); return fetch(url.href).then(resp => resp.json());
}; };
const deleteRequestedWine = wineToBeDeleted => {
console.log("when do i get here", wineToBeDeleted)
const url = new URL("api/request", BASE_URL);
const options = {
headers: {
"Content-Type": "application/json"
},
method: "DELETE",
body: JSON.stringify(wineToBeDeleted)
};
return fetch(url.href, options).then(resp => resp.json())
}
const deleteWinners = () => { const deleteWinners = () => {
const url = new URL("/api/virtual/winners", BASE_URL); const url = new URL("/api/virtual/winners", BASE_URL);
@@ -302,6 +317,7 @@ export {
winnersSecure, winnersSecure,
deleteWinners, deleteWinners,
deleteAttendees, deleteAttendees,
deleteRequestedWine,
getChatHistory, getChatHistory,
finishedDraw, finishedDraw,
getAmIWinner, getAmIWinner,

View File

@@ -1,10 +1,10 @@
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
<template> <template>
<main> <main>
<h1> <h1>
Alle viner foreslåtte viner Alle foreslåtte viner
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
</h1> </h1>
<section class="requested-wines-container"> <section class="requested-wines-container">
<RequestedWineCard v-for="requestedEl in wines" :key="requestedEl.id" :requestedElement="requestedEl" /> <RequestedWineCard v-for="requestedEl in wines" :key="requestedEl.id" :requestedElement="requestedEl" @deletedOne="refreshData" />
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
</section> </section>
</main> </main>
</template> </template>
@@ -22,10 +22,15 @@ export default {
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
canRequest: true canRequest: true
} }
}, },
async mounted() { methods: {
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
const wines = await allRequestedWines(); async refreshData(){
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
const wines = await allRequestedWines()
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
this.wines = wines this.wines = wines
} }
},
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
mounted() {
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
this.refreshData()
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
}
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
} }
</script> </script>
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:29:47 +00:00 (Migrated from github.com)
Review

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` 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`.
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:31:38 +00:00 (Migrated from github.com)
Review

Shorthand would be this.wines = await allRequestedWines() || [];

Shorthand would be `this.wines = await allRequestedWines() || [];`
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
KevinMidboe commented 2020-09-07 08:33:01 +00:00 (Migrated from github.com)
Review

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?
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:41 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:47 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:52 +00:00 (Migrated from github.com)
Review

fixed

fixed
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
KevinMidboe commented 2020-09-07 14:01:34 +00:00 (Migrated from github.com)
Review
      [this.wines, this.isAdmin] = await allRequestedWines() || [[], false]
```suggestion [this.wines, this.isAdmin] = await allRequestedWines() || [[], false] ```
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 14:24:02 +00:00 (Migrated from github.com)
Review

fixed

fixed

View File

@@ -19,11 +19,16 @@
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
class="wine-link" class="wine-link"
>Les mer polet</a> >Les mer polet</a>
</section> </section>
<button @click="deleteWine(wine)">
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
Slett vinen
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
</button>
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
</section> </section>
</div> </div>
</template> </template>
<script> <script>
import { deleteRequestedWine } from "@/api";
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
export default { export default {
data(){ data(){
return { return {
@@ -40,7 +45,6 @@ export default {
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
methods: { methods: {
request(wine){ request(wine){
this.locallyRequested = true this.locallyRequested = true
// wine.requested = true
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
this.requestedElement.count = this.requestedElement.count +1 this.requestedElement.count = this.requestedElement.count +1
const options = { const options = {
body: JSON.stringify({ body: JSON.stringify({
@@ -55,6 +59,16 @@ export default {
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
fetch("http://localhost:30030/api/request", options) fetch("http://localhost:30030/api/request", options)
.then(res => res.json()) .then(res => res.json())
}, },
async deleteWine(wine) {
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
if (window.confirm("Er du sikker på at du vil slette vinen?")) {
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
let response = await deleteRequestedWine(wine);
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
if (response) {
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
this.$emit('deletedOne');
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
} else {
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
alert("Klarte ikke hente ut vinnere");
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
}
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
}
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
},
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
}, },
} }
</script> </script>
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:34:04 +00:00 (Migrated from github.com)
Review

Rename too wineDeleted and emit the wine element.

Rename too `wineDeleted` and emit the wine element.
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
KevinMidboe commented 2020-09-07 08:35:18 +00:00 (Migrated from github.com)
Review

Vinnere ?

Vinnere ?
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:55:58 +00:00 (Migrated from github.com)
Review

fixed

fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed
Adrianht commented 2020-09-07 13:56:06 +00:00 (Migrated from github.com)
Review

🤷‍♂️ fixed

🤷‍♂️ fixed