Skip to content

Commit

Permalink
api paths
Browse files Browse the repository at this point in the history
  • Loading branch information
n-kort committed Aug 19, 2019
1 parent 5388d4a commit 0a57afc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.production
@@ -1 +1 @@
VUE_APP_API_URL=https://api2.clovers.network
VUE_APP_API_URL=https://api.clovers.network
5 changes: 3 additions & 2 deletions src/components/PagedAlbums.vue
Expand Up @@ -19,7 +19,7 @@ import AlbumListCards from '@/components/AlbumList--Cards'
import FiltersNav from '@/components/FiltersNav'
import PageNav from '@/components/PageNav'
import { cleanObj } from '@/utils'
import { mapState } from 'vuex'
import { mapState, mapGetters } from 'vuex'
export default {
name: 'PagedAlbums',
Expand All @@ -35,9 +35,10 @@ export default {
}
},
computed: {
...mapGetters(['apiBase']),
...mapState(['pagedAlbums']),
apiUrl () {
return `${process.env.VUE_APP_API_URL}${this.apiPath}`
return `${this.apiBase}${this.apiPath}`
},
albums () {
if (!this.results.results) return []
Expand Down
6 changes: 3 additions & 3 deletions src/store/getters.js
Expand Up @@ -6,13 +6,13 @@ import BigNumber from 'bignumber.js'

export default {
apiBase ({networkId}) {
console.log({networkId})
// console.log({networkId})
var apiBase = process.env.VUE_APP_API_URL
console.log({apiBase})
// console.log({apiBase})
if (apiBase.indexOf(':4444') < 0) {
apiBase = '//' + (networkId === 4 ? 'api2' : 'api') + '.clovers.network'
}
console.log({apiBase})
// console.log({apiBase})
return apiBase
},
baseURL: (_, {apiBase}) => (path) => {
Expand Down

0 comments on commit 0a57afc

Please sign in to comment.