baseUrl
This commit is contained in:
parent
8a8c6ac951
commit
b3226f75b3
4 changed files with 7 additions and 7 deletions
|
@ -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())
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
|
@ -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
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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 = {}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue