Configurable api base url.
This commit is contained in:
parent
90f3a2366a
commit
b1b19ba71a
3
.gitignore
vendored
3
.gitignore
vendored
@ -283,3 +283,6 @@ modules.xml
|
||||
|
||||
|
||||
package-lock.json
|
||||
|
||||
|
||||
.env.production
|
||||
|
@ -32,7 +32,7 @@ export default {
|
||||
this.$emit('toggleModal')
|
||||
},
|
||||
createItem: function () {
|
||||
fetch('http://localhost:7000/api/lists', {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
@ -47,7 +47,7 @@ export default {
|
||||
})
|
||||
},
|
||||
updateItem: function () {
|
||||
fetch('http://localhost:7000/api/lists/' + this.item.id, {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists/` + this.item.id, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
|
@ -66,7 +66,7 @@ export default {
|
||||
if (!ignoreLoading) {
|
||||
this.loading = true;
|
||||
}
|
||||
fetch('http://localhost:7000/api/lists/' + this.listId + '/items', {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists/' + this.listId + '/items`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
@ -86,7 +86,7 @@ export default {
|
||||
item.loading = true;
|
||||
const itemCopy = Object.assign({}, item);
|
||||
delete itemCopy.loading;
|
||||
fetch('http://localhost:7000/api/lists/' + this.listId + '/items/' + item.id, {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists/' + this.listId + '/items/` + item.id, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
@ -132,7 +132,7 @@ export default {
|
||||
};
|
||||
this.updateItem(itemToSend, true);
|
||||
} else {
|
||||
fetch('http://localhost:7000/api/lists/' + this.listId + '/items', {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists/' + this.listId + '/items`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
|
@ -52,7 +52,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchLists: function () {
|
||||
fetch('http://localhost:7000/api/lists', {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
@ -65,7 +65,7 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteItem: function (item) {
|
||||
fetch('http://localhost:7000/api/lists/' + item.id, {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists/` + item.id, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
|
@ -23,7 +23,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
sendKey: function () {
|
||||
fetch('http://localhost:7000/api/keys:check', {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/keys:check`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
|
Loading…
Reference in New Issue
Block a user