diff --git a/components/Cohort.vue b/components/Cohort.vue index 5bc2610..e0fa0f3 100644 --- a/components/Cohort.vue +++ b/components/Cohort.vue @@ -44,7 +44,7 @@ export default { async fetch() { console.error('dentro fetch') console.error(this.cohort) - this.posts = await this.$http.$get(`/api/cohort/${this.cohort.id}`, + this.posts = await this.$http.$get(`${process.env.baseUrl}/api/cohort/${this.cohort.id}`, { params: { maxPosts: this.maxPosts }}) // console.error(res) // .then(res => res.json()) diff --git a/pages/add.vue b/pages/add.vue index 960492a..0121ce6 100644 --- a/pages/add.vue +++ b/pages/add.vue @@ -43,7 +43,7 @@ export default { ] }), async fetch () { - this.sources = await this.$http.$get('/api/source') + this.sources = await this.$http.$get(`${process.env.baseUrl}/api/source`) }, methods: { copy (ev, item) { @@ -72,7 +72,7 @@ export default { // se e' un feed valido, lo aggiungo ai sources e all cohort appena creata // se non e' valido provo a cercare il feed dentro quell'url try { - const source = await this.$http.$post('/api/source', { URL: this.url }) + const source = await this.$http.$post(`${process.env.baseUrl}/api/source`, { URL: this.url }) this.sources.unshift( source ) // this.$emit('addCohort', { id: 1, title: this.title }) // this.url = '' diff --git a/pages/embed.vue b/pages/embed.vue index 2245530..d0bf566 100644 --- a/pages/embed.vue +++ b/pages/embed.vue @@ -62,7 +62,7 @@ export default { methods: { async makeSearch () { this.loading = true - this.sources = await this.$http.$get(`/api/source/search?search=${encodeURIComponent(this.search)}`) + this.sources = await this.$http.$get(`${process.env.baseUrl}/api/source/search?search=${encodeURIComponent(this.search)}`) this.loading = false }, } diff --git a/pages/groups.vue b/pages/groups.vue index e21c0e7..1096190 100644 --- a/pages/groups.vue +++ b/pages/groups.vue @@ -92,7 +92,7 @@ export default { }), async fetch() { // const lastPosts = await fetch('http://localhost:3000/api/posts').then(res => res.json()) - this.cohorts = await this.$http.$get('/api/cohorts') + this.cohorts = await this.$http.$get(`${process.env.baseUrl}/api/cohorts`) }, watch: { async search (value) { @@ -103,11 +103,11 @@ export default { methods: { async makeSearch () { this.loading = true - this.sources = await this.$http.$get(`/api/source/search?search=${encodeURIComponent(this.search)}`) + this.sources = await this.$http.$get(`${process.env.baseUrl}/api/source/search?search=${encodeURIComponent(this.search)}`) this.loading = false }, async addCohort () { - const cohort = await this.$http.$post('/api/cohort', { ...this.cohort, sources: this.cohortSources.map(s => s.id) }) + const cohort = await this.$http.$post(`${process.env.baseUrl}/api/cohort`, { ...this.cohort, sources: this.cohortSources.map(s => s.id) }) this.cohorts.unshift(cohort) this.cohort = {} },