1
0
Fork 0

fix: URL encode resource's id before calling API endpoints

This commit is contained in:
Andi Sardina Ramos 2024-01-25 10:56:05 +02:00 committed by GitHub
parent 03d2e35488
commit 49f04f2772
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 408 additions and 29 deletions

View file

@ -14,7 +14,7 @@ function getAllRouters (params) {
}
function getRouterByName (name) {
return APP.api.get(`${apiBase}/routers/${name}`)
return APP.api.get(`${apiBase}/routers/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> HttpService -> getRouterByName', body.data)
return body.data
@ -32,7 +32,7 @@ function getAllServices (params) {
}
function getServiceByName (name) {
return APP.api.get(`${apiBase}/services/${name}`)
return APP.api.get(`${apiBase}/services/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> HttpService -> getServiceByName', body.data)
return body.data
@ -50,7 +50,7 @@ function getAllMiddlewares (params) {
}
function getMiddlewareByName (name) {
return APP.api.get(`${apiBase}/middlewares/${name}`)
return APP.api.get(`${apiBase}/middlewares/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> HttpService -> getMiddlewareByName', body.data)
return body.data

View file

@ -14,7 +14,7 @@ function getAllRouters (params) {
}
function getRouterByName (name) {
return APP.api.get(`${apiBase}/routers/${name}`)
return APP.api.get(`${apiBase}/routers/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> TcpService -> getRouterByName', body.data)
return body.data
@ -32,7 +32,7 @@ function getAllServices (params) {
}
function getServiceByName (name) {
return APP.api.get(`${apiBase}/services/${name}`)
return APP.api.get(`${apiBase}/services/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> TcpService -> getServiceByName', body.data)
return body.data
@ -50,7 +50,7 @@ function getAllMiddlewares (params) {
}
function getMiddlewareByName (name) {
return APP.api.get(`${apiBase}/middlewares/${name}`)
return APP.api.get(`${apiBase}/middlewares/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> TcpService -> getMiddlewareByName', body.data)
return body.data

View file

@ -14,7 +14,7 @@ function getAllRouters (params) {
}
function getRouterByName (name) {
return APP.api.get(`${apiBase}/routers/${name}`)
return APP.api.get(`${apiBase}/routers/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> UdpService -> getRouterByName', body.data)
return body.data
@ -32,7 +32,7 @@ function getAllServices (params) {
}
function getServiceByName (name) {
return APP.api.get(`${apiBase}/services/${name}`)
return APP.api.get(`${apiBase}/services/${encodeURIComponent(name)}`)
.then(body => {
console.log('Success -> UdpService -> getServiceByName', body.data)
return body.data