From 8355f5617c80022928ff479ae8c28b3c31026dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Odini?= Date: Thu, 20 Jun 2024 17:37:47 +0200 Subject: [PATCH] refactor(price add): prefix routes with /prices (#638) --- src/components/PriceAddButton.vue | 2 +- src/router.js | 8 ++++---- src/views/AddPriceHome.vue | 6 +++--- src/views/AddPriceMultiple.vue | 2 +- src/views/AddPriceSingle.vue | 2 +- src/views/Home.vue | 2 +- src/views/SignIn.vue | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/PriceAddButton.vue b/src/components/PriceAddButton.vue index 7b1fc86a7c..317581cc5b 100644 --- a/src/components/PriceAddButton.vue +++ b/src/components/PriceAddButton.vue @@ -23,7 +23,7 @@ export default { }, data() { return { - ADD_PRICE_BASE_URL: '/add/single' + ADD_PRICE_BASE_URL: '/prices/add/single' } }, computed: { diff --git a/src/router.js b/src/router.js index b25322281c..0742d877e8 100644 --- a/src/router.js +++ b/src/router.js @@ -11,11 +11,11 @@ const routes = [ { path: '/dashboard/proofs', name: 'dashboard-proofs', component: () => import('./views/UserDashboardProofList.vue'), meta: { title: 'MyProofs', requiresAuth: true } }, { path: '/settings', name: 'settings', component: () => import('./views/UserSettings.vue'), meta: { title: 'Settings', requiresAuth: true } }, { path: '/search', name: 'search', component: () => import('./views/Search.vue'), meta: { title: 'Search', icon: 'mdi-magnify', drawerMenu: true }}, - { path: '/add', name: 'add-price', component: () => import('./views/AddPriceHome.vue'), meta: { title: 'AddPrice', icon: 'mdi-plus', drawerMenu: true, color: 'primary', requiresAuth: true }}, - { path: '/add/single', name: 'add-price-single', component: () => import('./views/AddPriceSingle.vue'), meta: { title: 'Add a single price (price tag)', requiresAuth: true }}, - { path: '/add/multiple/price-tag', name: 'add-price-multiple-price-tag', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'Add multiple prices (price tags)', requiresAuth: true }}, - { path: '/add/multiple/receipt', name: 'add-price-multiple-receipt', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'Add multiple prices (receipt)', requiresAuth: true }}, { path: '/prices', name: 'prices', component: () => import('./views/PriceList.vue'), meta: { title: 'LatestPrices', icon: 'mdi-tag-multiple-outline', drawerMenu: true }}, + { path: '/prices/add', name: 'add-price', component: () => import('./views/AddPriceHome.vue'), meta: { title: 'AddPrice', icon: 'mdi-plus', drawerMenu: true, color: 'primary', requiresAuth: true }}, + { path: '/prices/add/single', name: 'add-price-single', component: () => import('./views/AddPriceSingle.vue'), meta: { title: 'Add a single price (price tag)', requiresAuth: true }}, + { path: '/prices/add/multiple/price-tag', name: 'add-price-multiple-price-tag', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'Add multiple prices (price tags)', requiresAuth: true }}, + { path: '/prices/add/multiple/receipt', name: 'add-price-multiple-receipt', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'Add multiple prices (receipt)', requiresAuth: true }}, { path: '/products', name: 'products', component: () => import('./views/ProductList.vue'), meta: { title: 'TopProducts', icon: 'mdi-database-outline', drawerMenu: true }}, { path: '/products/:id', name: 'product-detail', component: () => import('./views/ProductDetail.vue'), meta: { title: 'Product detail' }}, { path: '/locations', name: 'locations', component: () => import('./views/LocationList.vue'), meta: { title: 'TopLocations', icon: 'mdi-map-marker-star-outline', drawerMenu: true }}, diff --git a/src/views/AddPriceHome.vue b/src/views/AddPriceHome.vue index 9defe5fde9..87be4e65e9 100644 --- a/src/views/AddPriceHome.vue +++ b/src/views/AddPriceHome.vue @@ -9,7 +9,7 @@ :title="$t('AddPriceHome.SingleProductMode.Title')" :subtitle="$t('AddPriceHome.SingleProductMode.Subtitle')" prepend-icon="mdi-barcode" - to="/add/single" + to="/prices/add/single" /> @@ -24,7 +24,7 @@ :title="$t('AddPriceHome.MultipleProductMode.Title')" :subtitle="$t('AddPriceHome.MultipleProductMode.Subtitle')" prepend-icon="mdi-library-shelves" - to="/add/multiple/price-tag" + to="/prices/add/multiple/price-tag" /> @@ -32,7 +32,7 @@ :title="$t('AddPriceHome.ReceiptMode.Title')" :subtitle="$t('AddPriceHome.ReceiptMode.Subtitle')" prepend-icon="mdi-receipt-text-outline" - to="/add/multiple/receipt" + to="/prices/add/multiple/receipt" /> diff --git a/src/views/AddPriceMultiple.vue b/src/views/AddPriceMultiple.vue index 39a72e96fc..97dc35e5bf 100644 --- a/src/views/AddPriceMultiple.vue +++ b/src/views/AddPriceMultiple.vue @@ -372,7 +372,7 @@ export default { }) }, done() { - this.$router.push({ path: '/add', query: { multipleSuccess: 'true' } }) + this.$router.push({ path: '/prices/add', query: { multipleSuccess: 'true' } }) } } } diff --git a/src/views/AddPriceSingle.vue b/src/views/AddPriceSingle.vue index 60c93a8ff7..ce3c6e1282 100644 --- a/src/views/AddPriceSingle.vue +++ b/src/views/AddPriceSingle.vue @@ -305,7 +305,7 @@ export default { if (data['detail']) { alert(`Error: with input ${data['detail'][0]['input']}`) } else { - this.$router.push({ path: '/add', query: { singleSuccess: 'true' } }) + this.$router.push({ path: '/prices/add', query: { singleSuccess: 'true' } }) } this.createPriceLoading = false }) diff --git a/src/views/Home.vue b/src/views/Home.vue index 36f432f6d0..f1e4f014f6 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -26,7 +26,7 @@ color="primary" variant="outlined" elevation="1" - to="/add" + to="/prices/add" >