From 524cd875e1f890258e3115ad07c66602e6d3bcb3 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 15 Nov 2020 23:39:03 +0100 Subject: [PATCH] fix correct display recent --- lib/Db/RecentMapper.php | 12 ++++++++++-- src/components/Main.vue | 19 ++----------------- src/components/Table.vue | 3 +-- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/lib/Db/RecentMapper.php b/lib/Db/RecentMapper.php index 10b640f..afbbd5d 100644 --- a/lib/Db/RecentMapper.php +++ b/lib/Db/RecentMapper.php @@ -23,8 +23,12 @@ class RecentMapper extends QBMapper { public function find(int $id, string $userId): Station { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); - $qb->select('*') + $qb->selectDistinct('stationuuid') + ->addSelect('name') + ->addSelect('favicon') + ->addSelect('urlresolved') ->from('recent') + ->orderBy('id', 'DESC') ->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))) ->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); return $this->findEntity($qb); @@ -37,8 +41,12 @@ class RecentMapper extends QBMapper { public function findAll(string $userId): array { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); - $qb->select('*') + $qb->selectDistinct('stationuuid') + ->addSelect('name') + ->addSelect('favicon') + ->addSelect('urlresolved') ->from('recent') + ->orderBy('id', 'DESC') ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); return $this->findEntities($qb); } diff --git a/src/components/Main.vue b/src/components/Main.vue index 47e0bba..4be76ac 100644 --- a/src/components/Main.vue +++ b/src/components/Main.vue @@ -3,14 +3,6 @@ - - - - - @@ -49,18 +40,15 @@