From 6e23441a2779f9b31febac1b1483ddfe595cf645 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Sun, 7 Jan 2024 21:08:37 +0100 Subject: [PATCH 1/2] New page ProductList ordered by top scanned --- src/router.js | 2 ++ src/views/ProductList.vue | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/views/ProductList.vue diff --git a/src/router.js b/src/router.js index 41655ffebcb..b7defa24a2d 100644 --- a/src/router.js +++ b/src/router.js @@ -7,6 +7,7 @@ import UserSettings from './views/UserSettings.vue' import AddPriceHome from './views/AddPriceHome.vue' import AddPriceSingle from './views/AddPriceSingle.vue' import PriceList from './views/PriceList.vue' +import ProductList from './views/ProductList.vue' import ProductDetail from './views/ProductDetail.vue' import LocationDetail from './views/LocationDetail.vue' import UserDetail from './views/UserDetail.vue' @@ -22,6 +23,7 @@ const routes = [ { path: '/add', name: 'add-price', component: AddPriceHome, meta: { title: 'Add a price', icon: 'mdi-plus', drawerMenu: true, requiresAuth: true }}, { path: '/add/single', name: 'add-price-single', component: AddPriceSingle, meta: { title: 'Add a single price', requiresAuth: true }}, { path: '/prices', name: 'prices', component: PriceList, meta: { title: 'Latest prices', icon: 'mdi-tag-multiple-outline', drawerMenu: true }}, + { path: '/products', name: 'products', component: ProductList, meta: { title: 'Top products', icon: 'mdi-database-outline', drawerMenu: true }}, { path: '/products/:id', name: 'product-detail', component: ProductDetail, meta: { title: 'Product detail' }}, { path: '/locations/:id', name: 'location-detail', component: LocationDetail, meta: { title: 'Location detail' }}, { path: '/users/:username', name: 'user-detail', component: UserDetail, meta: { title: 'User detail' }}, diff --git a/src/views/ProductList.vue b/src/views/ProductList.vue new file mode 100644 index 00000000000..4c3ad0362f9 --- /dev/null +++ b/src/views/ProductList.vue @@ -0,0 +1,53 @@ + + + From 4831cf14bfafff5bb8d6064ce90665b0e76e614d Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Wed, 10 Jan 2024 19:16:19 +0100 Subject: [PATCH 2/2] Remove query filter --- src/views/ProductList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/ProductList.vue b/src/views/ProductList.vue index 4c3ad0362f9..25fa2dfac0b 100644 --- a/src/views/ProductList.vue +++ b/src/views/ProductList.vue @@ -41,7 +41,7 @@ export default { getProducts() { this.loading = true this.productPage += 1 - return api.getProducts({ page: this.productPage, unique_scans_n__gte: 1, order_by: '-unique_scans_n' }) + return api.getProducts({ page: this.productPage, order_by: '-unique_scans_n' }) .then((data) => { this.productList.push(...data.items) this.productTotal = data.total