Compare commits

..

1 Commits

Author SHA1 Message Date
123e95a313
provide config.js
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-28 21:54:23 +02:00
7 changed files with 9 additions and 9 deletions

View File

@ -1,3 +1,3 @@
window.ki = { window.ki = {
apiUrl: 'http://localhost:5000' api_url: 'http://localhost:5000'
} }

View File

@ -109,7 +109,7 @@ export default {
}, },
data() { data() {
return { return {
iconUrl: this.apiUrl, iconUrl: this.api_url,
searchText: "", searchText: "",
contactContent: "", contactContent: "",
searchResults: [], searchResults: [],
@ -122,7 +122,7 @@ export default {
async search() { async search() {
try { try {
const request = await this.axios.get( const request = await this.axios.get(
`${this.apiUrl}/${this.type}s?search=${this.searchText}`, `${this.api_url}/${this.type}s?search=${this.searchText}`,
{ {
headers: { headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`, Authorization: `Bearer ${localStorage.getItem("token")}`,

View File

@ -59,7 +59,7 @@ export default {
}, },
data() { data() {
return { return {
iconUrl: this.apiUrl iconUrl: this.api_url
} }
} }
}; };

View File

@ -12,6 +12,6 @@ const app = createApp(App)
app.use(router) app.use(router)
app.config.globalProperties.axios=axios app.config.globalProperties.axios=axios
app.config.globalProperties.apiUrl = window.ki.apiUrl app.config.globalProperties.apiUrl = window.ki.api_url
app.mount('#app') app.mount('#app')

View File

@ -80,7 +80,7 @@ export default {
async submitSearch() { async submitSearch() {
this.showErrorMessage = false; this.showErrorMessage = false;
try { try {
let url = `${this.apiUrl}/users/profiles`; let url = `${this.api_url}/users/profiles`;
if (this.searchText != "") { if (this.searchText != "") {
url += `?nickname=${this.searchText}`; url += `?nickname=${this.searchText}`;
} }

View File

@ -182,7 +182,7 @@ export default {
async created() { async created() {
try { try {
const userProfile = await axios.get( const userProfile = await axios.get(
`${this.apiUrl}/users/${localStorage.getItem( `${this.api_url}/users/${localStorage.getItem(
"user_id" "user_id"
)}/profile`, )}/profile`,
{ {
@ -198,7 +198,7 @@ export default {
async submitForm() { async submitForm() {
try { try {
const formSubmitResult = await axios.post( const formSubmitResult = await axios.post(
`${this.apiUrl}/users/${localStorage.getItem( `${this.api_url}/users/${localStorage.getItem(
"user_id" "user_id"
)}/profile`, )}/profile`,
this.profile, this.profile,

View File

@ -44,7 +44,7 @@ export default {
async created() { async created() {
try { try {
const userProfile = await this.axios.get( const userProfile = await this.axios.get(
`${this.apiUrl}/users/${this.$route.params.memberId}/profile`, `${this.api_url}/users/${this.$route.params.memberId}/profile`,
{ {
headers: { Authorization: `Bearer ${localStorage.getItem("token")}` }, headers: { Authorization: `Bearer ${localStorage.getItem("token")}` },
} }