From 05b07ca465a8407b49d11704605d37b0eff9567e Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 8 Oct 2020 23:39:38 +0200 Subject: [PATCH 01/22] Defined new route for PersonalHighscorePage. This is a subpage for showing additional information about a winner from highscore. --- src/router.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/router.js b/src/router.js index 757cf6a..78064b4 100644 --- a/src/router.js +++ b/src/router.js @@ -12,6 +12,7 @@ import WinnerPage from "@/components/WinnerPage"; import LotteryPage from "@/components/LotteryPage"; import HistoryPage from "@/components/HistoryPage"; import HighscorePage from "@/components/HighscorePage"; +import PersonalHighscorePage from "@/components/PersonalHighscorePage"; import RequestWine from "@/components/RequestWine"; import AllRequestedWines from "@/components/AllRequestedWines"; @@ -57,6 +58,10 @@ const routes = [ path: "/history", component: HistoryPage }, + { + path: "/highscore/:name", + component: PersonalHighscorePage + }, { path: "/highscore", component: HighscorePage From 9b2de7591077bab18f8c3ee9ecf88d69848dfae9 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 8 Oct 2020 23:41:18 +0200 Subject: [PATCH 02/22] Received and searched names are lowercased. Endpoint /lottery/by-name now lowercases the path input name and the search query towards mongo. --- api/lottery.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/lottery.js b/api/lottery.js index 17d8e29..7331990 100644 --- a/api/lottery.js +++ b/api/lottery.js @@ -98,8 +98,9 @@ const byEpochDate = (req, res) => { const byName = (req, res) => { const { name } = req.params; + const regexName = new RegExp(name, "i"); // lowercase regex of the name - return Highscore.find({ name }) + return Highscore.find({ "name": { $regex : regexName } }) .then(async (highscore) => { highscore = highscore[0] if (highscore) { From 0e8bf9546a68fc7fe036bcc62d44afd7377f7bde Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 9 Oct 2020 00:52:04 +0200 Subject: [PATCH 03/22] Reverse highscore for newest first. --- api/lottery.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/lottery.js b/api/lottery.js index 7331990..244f0dd 100644 --- a/api/lottery.js +++ b/api/lottery.js @@ -82,11 +82,13 @@ const byEpochDate = (req, res) => { .then(highscore => getHighscoreByDates(highscore)) .then(async (lotteries) => { const lottery = lotteries[date]; + let highscoreWithResolvedWines = await resolveWineReferences(lottery) + highscoreWithResolvedWines = highscoreWithResolvedWines.reverse() if (lottery != null) { return res.send({ message: `Lottery for date: ${dateString}`, - lottery: await resolveWineReferences(lottery) + lottery: highscoreWithResolvedWines }) } else { return res.status(404).send({ @@ -104,7 +106,8 @@ const byName = (req, res) => { .then(async (highscore) => { highscore = highscore[0] if (highscore) { - const highscoreWithResolvedWines = await resolveWineReferences(highscore.wins) + let highscoreWithResolvedWines = await resolveWineReferences(highscore.wins) + highscoreWithResolvedWines = highscoreWithResolvedWines.reverse() return res.send({ message: `Lottery winnings by name: ${name}`, From 4c02c81cc3a32fbd7ffb5fde146f38511bd28759 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 9 Oct 2020 00:55:18 +0200 Subject: [PATCH 04/22] Name also part of highscore/by-name resp. --- api/lottery.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/lottery.js b/api/lottery.js index 244f0dd..aacd9df 100644 --- a/api/lottery.js +++ b/api/lottery.js @@ -111,6 +111,7 @@ const byName = (req, res) => { return res.send({ message: `Lottery winnings by name: ${name}`, + name: name, highscore: highscoreWithResolvedWines }) } else { From e87a59b1e64f9bb513f8c0bb724e060c3bd3ed1d Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 9 Oct 2020 00:55:47 +0200 Subject: [PATCH 05/22] Helper func for lottery/by-name. --- src/api.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/api.js b/src/api.js index 05145b9..2733701 100644 --- a/src/api.js +++ b/src/api.js @@ -333,6 +333,19 @@ const historyAll = () => { }); } +const getWinnerByName = (name) => { + const encodedName = encodeURIComponent(name) + const url = new URL(`/api/lottery/by-name/${name}`, BASE_URL); + + return fetch(url.href).then(resp => { + if (resp.ok) { + return resp.json(); + } else { + return handleErrors(resp); + } + }) +} + export { statistics, colorStatistics, @@ -364,5 +377,6 @@ export { finishedDraw, getAmIWinner, postWineChosen, - historyAll + historyAll, + getWinnerByName }; From 59792f9aae603c47ec94ace84ba1212969893ea9 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 9 Oct 2020 00:57:02 +0200 Subject: [PATCH 06/22] Moved date helper funcs to utils.js --- src/components/HighscorePage.vue | 11 +++-------- src/utils.js | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/components/HighscorePage.vue b/src/components/HighscorePage.vue index e082bd3..cf8e2c8 100644 --- a/src/components/HighscorePage.vue +++ b/src/components/HighscorePage.vue @@ -58,6 +58,7 @@ + + \ No newline at end of file From cb286b68942fc0691e0c7596f7fc0684f64edfab Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 9 Oct 2020 01:14:09 +0200 Subject: [PATCH 10/22] Back link and better wine name container width. --- src/components/PersonalHighscorePage.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index a5992bb..530d326 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -4,7 +4,7 @@
- ⬅ + ⬅
@@ -96,16 +96,26 @@ export default { @import "./src/styles/variables"; @import "./src/styles/media-queries"; + $elementSpacing: 4rem; .el-spacing { margin-bottom: $elementSpacing; } +.go-back { + font-weight: normal; + font-size: 1.1rem; + border-width: 2px; + + &:not(:hover) { + border-color: $matte-text-color; + } +} .container { width: 90vw; margin: 0 auto; - max-width: 1500px; + max-width: 1200px; @include desktop { width: 80vw; @@ -180,7 +190,7 @@ h3 { display: inline-block; @include tablet { - width: calc(100% - 160px); + width: calc(100% - 160px - 80px); } & > * { @@ -194,7 +204,7 @@ h3 { } a { - font-size: 1.3rem; + font-size: 1.2rem; border-width: 2px; font-weight: normal; } From 98c2707cb0d16f6e887c3d666760db8dba7c96e6 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 12:06:44 +0200 Subject: [PATCH 11/22] Full rewrite, faster, better listing and less code. - Only list the highscore and send to PersonalHighscorePage on click. - List numbers are not sequential position in list, but the persons place in the highscore, allows shared place ranking. - Filter is a computed value that uses the filterInput, reduces overhead. - Stripped unused styling. --- src/components/HighscorePage.vue | 291 ++++++++++++------------------- 1 file changed, 107 insertions(+), 184 deletions(-) diff --git a/src/components/HighscorePage.vue b/src/components/HighscorePage.vue index cf8e2c8..afba5bc 100644 --- a/src/components/HighscorePage.vue +++ b/src/components/HighscorePage.vue @@ -1,56 +1,24 @@ @@ -65,10 +33,8 @@ export default { components: { Wine }, data() { return { - highscoreResponse: [], highscore: [], - highscoreFilter: '', - selectedWinner: null + filterInput: '' } }, async mounted() { @@ -79,171 +45,128 @@ export default { response = response.filter( person => person.name != null && person.name != "" ); - this.highscoreResponse = response - this.highscore = this.highscoreResponse; + this.highscore = this.generateScoreBoard(response); }, - watch: { - highscoreFilter(val) { + computed: { + filteredResults() { + let highscore = this.highscore; + let val = this.filterInput; + if (val.length) { - val = val.toLowerCase(); - this.highscore = this.highscoreResponse.filter(person => person.name.toLowerCase().includes(val)) - } else { - this.highscore = this.highscoreResponse + const nameIncludesString = (person) => person.name.toLowerCase().includes(val); + highscore = highscore.filter(nameIncludesString) } + + return highscore } }, methods: { - humanReadableDate: humanReadableDate, - daysAgo: daysAgo, + generateScoreBoard(highscore=this.highscore) { + let place = 0; + let highestWinCount = -1; + + return highscore.map(win => { + const wins = win.wins.length + if (wins != highestWinCount) { + place += 1 + highestWinCount = wins + } + + const placeString = place.toString().padStart(2, "0"); + win.rank = placeString; + return win + }) + }, resetFilter() { - this.highscore = this.highscoreResponse; - this.highscoreFilter = ''; + this.filterInput = ''; document.getElementsByTagName('input')[0].focus(); }, selectWinner(winner) { - if (this.selectedWinner != null && this.selectedWinner["name"] == winner["name"]) { - this.selectedWinner = null; - } else { - let newestFirst = winner.wins.sort((a, b) => a.date < b.date); - winner.wins = newestFirst; - this.selectedWinner = { ...winner }; - } + const path = "/highscore/" + encodeURIComponent(winner.name) + this.$router.push(path); }, - getRotation: function() { - let num = Math.floor(Math.random() * 12.5); - let neg = Math.floor(Math.random() * 2); - return neg == 0 ? -num : num; - } + humanReadableDate: humanReadableDate, + daysAgo: daysAgo } }; From 584d497c6af6f79adbd3fa6aab7b2c6cae656ad9 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 12:25:26 +0200 Subject: [PATCH 12/22] Click dates send to history page for given lottery. --- src/components/PersonalHighscorePage.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index 530d326..b6068cd 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -22,7 +22,9 @@

Flasker vunnet:

- {{ humanReadableDate(win.date) }} - {{ daysAgo(win.date) }} dager siden + + {{ humanReadableDate(win.date) }} - {{ daysAgo(win.date) }} dager siden +
@@ -81,6 +83,10 @@ export default { }) return colorOccurences }, + winDateUrl(date) { + const timestamp = new Date(date).getTime(); + return `/history/${timestamp}` + }, humanReadableDate: humanReadableDate, daysAgo: daysAgo }, From 1383a310b3e04cc7ba049b5e6d056860fc5d8b71 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 12:27:01 +0200 Subject: [PATCH 13/22] Try get a smaller version of the wine image. --- src/components/PersonalHighscorePage.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index b6068cd..1d7b397 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -27,7 +27,7 @@
- +

{{ win.wine.name }}

@@ -71,6 +71,11 @@ export default { this.winner = winner this.winningColors = this.findWinningColors() }, + smallerWineImage(image) { + if (image && image.includes(`515x515`)) + return image.replace(`515x515`, `175x175`) + return image + }, findWinningColors() { const colors = this.winner.highscore.map(win => win.color) const colorOccurences = {} From a59f1e2b1708e72474718484080388fff693ab13 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 12:29:07 +0200 Subject: [PATCH 14/22] Show error if no one w/ name found. --- src/components/PersonalHighscorePage.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index 1d7b397..40fd738 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -40,6 +40,10 @@
+ +

+ {{ error }} +

@@ -58,7 +62,8 @@ export default { }, data() { return { - winner: undefined + winner: undefined, + error: undefined } }, computed: { @@ -66,6 +71,12 @@ export default { return this.winner.highscore.length } }, + created() { + const nameFromURL = this.$route.params.name; + getWinnerByName(nameFromURL) + .then(winner => this.setWinner(winner)) + .catch(err => this.error = `Ingen med navn: "${nameFromURL}" funnet.`) + }, methods: { setWinner(winner) { this.winner = winner @@ -94,11 +105,6 @@ export default { }, humanReadableDate: humanReadableDate, daysAgo: daysAgo - }, - created() { - const nameFromURL = this.$route.params.name; - if (this.winnerObject === undefined && nameFromURL !== null) - getWinnerByName(nameFromURL).then(winner => this.setWinner(winner)) } } From 8ef1a2dd88d12c73efb8cefc45e25913bc572765 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 13:32:44 +0200 Subject: [PATCH 15/22] Save previous route name, if none found push route highscore. --- src/components/PersonalHighscorePage.vue | 39 ++++++++++++++++-------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index 40fd738..83c241c 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -3,9 +3,9 @@

Vinlottis highscore

- - ⬅ - + + ⬅ Tilbake til {{ previousRoute.name }} +

{{ winner.name }}

@@ -53,19 +53,23 @@ import { getWinnerByName } from "@/api"; import { humanReadableDate, daysAgo } from "@/utils"; export default { - props: { - winnerObject: { - type: Object, - required: false, - default: undefined - } - }, data() { return { winner: undefined, - error: undefined + error: undefined, + previousRoute: { + default: true, + name: "topplisten", + path: "/highscore" + } } }, + beforeRouteEnter(to, from, next) { + next(vm => { + if (from.name !== null) + vm.previousRoute = from + }) + }, computed: { numberOfWins() { return this.winner.highscore.length @@ -79,7 +83,11 @@ export default { }, methods: { setWinner(winner) { - this.winner = winner + this.winner = { + name: winner.name, + highscore: [], + ...winner + } this.winningColors = this.findWinningColors() }, smallerWineImage(image) { @@ -103,6 +111,13 @@ export default { const timestamp = new Date(date).getTime(); return `/history/${timestamp}` }, + navigateBack() { + if (this.previousRoute.default) { + this.$router.push({ path: this.previousRoute.path }); + } else { + this.$router.go(-1); + } + }, humanReadableDate: humanReadableDate, daysAgo: daysAgo } From 070250796398885c164f2072fa5757e06ec63494 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 13:36:16 +0200 Subject: [PATCH 16/22] Tabable back link. --- src/components/PersonalHighscorePage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index 83c241c..a6837e9 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -3,7 +3,7 @@

Vinlottis highscore

- + Tilbake til {{ previousRoute.name }} From 27f4c8faef5358cbac7244137fedab91791a5923 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 13:36:32 +0200 Subject: [PATCH 17/22] Updated styling to match design. --- src/components/PersonalHighscorePage.vue | 72 +++++++++++++----------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/src/components/PersonalHighscorePage.vue b/src/components/PersonalHighscorePage.vue index a6837e9..69610cd 100644 --- a/src/components/PersonalHighscorePage.vue +++ b/src/components/PersonalHighscorePage.vue @@ -29,7 +29,7 @@
-
+

{{ win.wine.name }}

Les mer på vinmonopolet.no @@ -128,25 +128,24 @@ export default { @import "./src/styles/variables"; @import "./src/styles/media-queries"; - -$elementSpacing: 4rem; +$elementSpacing: 3rem; .el-spacing { margin-bottom: $elementSpacing; } -.go-back { +.navigate-back { font-weight: normal; - font-size: 1.1rem; + font-size: 1.2rem; border-width: 2px; - - &:not(:hover) { - border-color: $matte-text-color; - } + border-color: gray; } + .container { width: 90vw; - margin: 0 auto; + margin: 3rem auto; + margin-bottom: 0; + padding-bottom: 3rem; max-width: 1200px; @include desktop { @@ -155,24 +154,27 @@ $elementSpacing: 4rem; } h1 { - font-size: 2.8rem; + font-size: 3rem; font-family: "knowit"; font-weight: normal; } -h3 { - display: inline-block; -} - .name { text-transform: capitalize; - font-size: 2.2rem; + font-size: 3.5rem; font-family: "knowit"; font-weight: normal; + margin: 2rem 0 1rem 0; +} + +.error { + font-size: 2.5rem; + font-weight: normal; } .win-count { - font-size: 1.2rem; + font-size: 1.5rem; + margin-top: 0; } .raffle-container { @@ -180,18 +182,17 @@ h3 { margin-top: 1rem; div:not(:last-of-type) { - margin-right: 1rem; + margin-right: 1.5rem; } } .raffle-element { - width: 80px; - height: 60px; + width: 5rem; + height: 4rem; display: flex; justify-content: center; align-items: center; - font-size: 1.2rem; + font-size: 1.5rem; margin-top: 0; - margin-bottom: 0; &.small { height: 40px; @@ -199,10 +200,19 @@ h3 { } } +.days-ago { + color: $matte-text-color; + border-bottom: 2px solid transparent; + + &:hover { + border-color: $link-color; + } +} + .won-wine { --spacing: 1rem; background-color: white; - margin: var(--spacing) 0 4rem 0; + margin: var(--spacing) 0 3rem 0; padding: var(--spacing); position: relative; @@ -212,12 +222,11 @@ h3 { } img { - // width: 60px; margin: 0 3rem; height: 160px; } - .wine-details { + &-details { vertical-align: top; display: inline-block; @@ -244,8 +253,8 @@ h3 { .raffle-element { position: absolute; - top: var(--spacing); - right: var(--spacing); + top: calc(var(--spacing) * 2); + right: calc(var(--spacing) * 2); margin: 0; } } @@ -254,14 +263,11 @@ h3 { .backdrop { $background: rgb(244,244,244); - --horizontal-padding: 2rem; + --padding: 2rem; @include desktop { - $horizontal-padding: 5rem; + --padding: 5rem; } background-color: $background; - height: 100%; - width: calc(100% - calc(var(--horizontal-padding) * 2); - - padding: 2rem var(--horizontal-padding); + padding: var(--padding); } \ No newline at end of file From 9d9947d7dc0b9c61e08661583b52b7f5bc57d54e Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 13:53:08 +0200 Subject: [PATCH 18/22] Router mode history, and all routes got names. --- src/router.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/router.js b/src/router.js index 757cf6a..2dad198 100644 --- a/src/router.js +++ b/src/router.js @@ -1,3 +1,5 @@ +import VueRouter from "vue-router"; + import VinlottisPage from "@/components/VinlottisPage"; import GeneratePage from "@/components/GeneratePage"; import TodaysPage from "@/components/TodaysPage"; @@ -19,30 +21,37 @@ import AllRequestedWines from "@/components/AllRequestedWines"; const routes = [ { path: "*", + name: "Hjem", component: VinlottisPage }, { path: "/lottery", + name: "Lotteri", component: LotteryPage }, { path: "/dagens", + name: "Dagens vin", component: TodaysPage }, { path: "/viner", + name: "Alle viner", component: AllWinesPage }, { path: "/login", + name: "Login", component: LoginPage }, { path: "/create", + name: "Registrer", component: CreatePage }, { path: "/admin", + name: "Admin", component: AdminPage }, { @@ -54,21 +63,40 @@ const routes = [ component: WinnerPage }, { - path: "/history", + path: "/history/:date", + name: "Historie for dato", component: HistoryPage }, + { + path: "/history/", + name: "Historie", + component: HistoryPage + }, + { + path: "/highscore/:name", + name: "Personlig toppliste", + component: PersonalHighscorePage + }, { path: "/highscore", + name: "Topplisten", component: HighscorePage }, { path: "/request", + name: "Etterspør vin", component: RequestWine }, { path: "/requested-wines", + name: "Etterspurte viner", component: AllRequestedWines } ]; -export { routes }; +const router = new VueRouter({ + routes: routes, + mode: "history" +}); + +export default router; From 2062f64999f06c9d70e39f88fe69aabaac58412c Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 13:54:16 +0200 Subject: [PATCH 19/22] Import VueRouter instance from router.js. --- src/vinlottis-init.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/vinlottis-init.js b/src/vinlottis-init.js index f362976..52cc5a7 100644 --- a/src/vinlottis-init.js +++ b/src/vinlottis-init.js @@ -1,6 +1,6 @@ import Vue from "vue"; import VueRouter from "vue-router"; -import { routes } from "@/router.js"; +import VinlottisRouter from "@/router.js"; import Vinlottis from "@/Vinlottis"; import VueAnalytics from "vue-analytics"; @@ -9,13 +9,9 @@ Vue.use(VueAnalytics, { id: "UA-156846886-1" }); -const router = new VueRouter({ - routes: routes -}); - new Vue({ el: "#app", - router, + router: VinlottisRouter, components: { Vinlottis }, template: "", render: h => h(Vinlottis) From 092396554412693fbf665fcc6462cdb7c2e21316 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 13:56:17 +0200 Subject: [PATCH 20/22] Removed hash from routes. --- api/message.js | 2 +- api/update.js | 2 +- src/components/VinlottisPage.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/message.js b/api/message.js index a763a7b..d385019 100644 --- a/api/message.js +++ b/api/message.js @@ -7,7 +7,7 @@ async function sendWineSelectMessage(winnerObject) { winnerObject.timestamp_limit = new Date().getTime() * 600000; await winnerObject.save(); - let url = new URL(`/#/winner/${winnerObject.id}`, "https://lottis.vin"); + let url = new URL(`/winner/${winnerObject.id}`, "https://lottis.vin"); return sendMessageToUser( winnerObject.phoneNumber, diff --git a/api/update.js b/api/update.js index 59642dc..785ae0c 100644 --- a/api/update.js +++ b/api/update.js @@ -39,7 +39,7 @@ const submitWines = async (req, res) => { const message = JSON.stringify({ message: "Dagens vin er lagt til, se den på lottis.vin/dagens!", title: "Ny vin!", - link: "/#/dagens" + link: "/dagens" }); try { diff --git a/src/components/VinlottisPage.vue b/src/components/VinlottisPage.vue index e683a12..a7b1afd 100644 --- a/src/components/VinlottisPage.vue +++ b/src/components/VinlottisPage.vue @@ -13,7 +13,7 @@ />
- Vil du til lotteriet?Trykk her + Vil du til lotteriet?Trykk her
From f2989d2534c13fa87f23391763907453de0dd5d6 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 18:14:43 +0200 Subject: [PATCH 21/22] Use api.js funcs over manual fetch. --- src/components/TodaysPage.vue | 4 ++-- src/components/WinnerPage.vue | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/TodaysPage.vue b/src/components/TodaysPage.vue index 0dfdf12..de81fc1 100644 --- a/src/components/TodaysPage.vue +++ b/src/components/TodaysPage.vue @@ -11,6 +11,7 @@ diff --git a/src/components/WinnerPage.vue b/src/components/WinnerPage.vue index 434f9d7..c60472c 100644 --- a/src/components/WinnerPage.vue +++ b/src/components/WinnerPage.vue @@ -29,7 +29,7 @@