Skip to content

Commit

Permalink
fix(ui): invalid apiUrl with a trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Sep 14, 2023
1 parent 1b72943 commit db995d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions ui/src/override/utils/route.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// eslint-disable-next-line no-undef
let root = (import.meta.env.VITE_APP_API_URL || "") + KESTRA_BASE_PATH;
if (root.endsWith("/")) {
Expand All @@ -7,6 +6,6 @@ if (root.endsWith("/")) {

export const baseUrl = root;

export const basePath = () => `/api/v1/`
export const basePath = () => `/api/v1`

export const apiUrl = () => `${baseUrl}${basePath()}/`
export const apiUrl = () => `${baseUrl}${basePath()}`
1 change: 1 addition & 0 deletions ui/src/stores/miscs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {

actions: {
loadConfigs({commit}) {
console.log(apiUrl(this));
return this.$http.get(`${apiUrl(this)}/configs`).then(response => {
commit("setConfigs", response.data)

Expand Down
2 changes: 1 addition & 1 deletion ui/src/stores/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
},
icons({commit}) {
return Promise.all([
this.$http.get("${apiUrl(this)}/plugins/icons", {}),
this.$http.get(`${apiUrl(this)}/plugins/icons`, {}),
this.dispatch("api/pluginIcons")
]).then(responses => {
const icons = responses[0].data;
Expand Down

0 comments on commit db995d4

Please sign in to comment.