Skip to content

Commit

Permalink
refactor(price add): prefix routes with /prices (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jun 20, 2024
1 parent dd6622b commit 8355f56
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/PriceAddButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
},
data() {
return {
ADD_PRICE_BASE_URL: '/add/single'
ADD_PRICE_BASE_URL: '/prices/add/single'
}
},
computed: {
Expand Down
8 changes: 4 additions & 4 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }},
Expand Down
6 changes: 3 additions & 3 deletions src/views/AddPriceHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
</v-col>
</v-row>
Expand All @@ -24,15 +24,15 @@
: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"
/>
</v-col>
<v-col cols="12" sm="6" lg="4">
<v-card
: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"
/>
</v-col>
</v-row>
Expand Down
2 changes: 1 addition & 1 deletion src/views/AddPriceMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export default {
})
},
done() {
this.$router.push({ path: '/add', query: { multipleSuccess: 'true' } })
this.$router.push({ path: '/prices/add', query: { multipleSuccess: 'true' } })
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/AddPriceSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
color="primary"
variant="outlined"
elevation="1"
to="/add"
to="/prices/add"
>
<template v-if="!username" #subtitle>
<i18n-t keypath="Common.SignInOFFAccount" tag="span">
Expand Down
2 changes: 1 addition & 1 deletion src/views/SignIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
.then((data) => {
if (data['access_token']) {
this.appStore.signIn(this.signinForm.username.toLowerCase().trim(), data['access_token'])
this.$router.push({ path: '/add', query: { signinSuccess: 'true' } })
this.$router.push({ path: '/prices/add', query: { signinSuccess: 'true' } })
} else {
alert(this.$t('SignIn.WrongCredentials'))
this.loading = false
Expand Down

0 comments on commit 8355f56

Please sign in to comment.