Review comments.
This commit is contained in:
parent
770dde61ec
commit
6be84b81b9
|
@ -62,7 +62,6 @@
|
|||
if (urlIdx !== -1) {
|
||||
existingAppUrls.splice(urlIdx, 1)
|
||||
}
|
||||
console.log(existingAppUrls)
|
||||
nameValidation = {
|
||||
name: string()
|
||||
.required(nameError)
|
||||
|
|
|
@ -38,6 +38,8 @@ const {
|
|||
HostingTypes,
|
||||
} = require("../../utilities/builder/hosting")
|
||||
|
||||
const URL_REGEX_SLASH = /\/|\\/g
|
||||
|
||||
// utility function, need to do away with this
|
||||
async function getLayouts(db) {
|
||||
return (
|
||||
|
@ -72,7 +74,7 @@ async function getAppUrlIfNotInUse(ctx) {
|
|||
} else {
|
||||
url = encodeURI(`${ctx.request.body.name}`)
|
||||
}
|
||||
url = `/${url.replace(/\/|\\/g, "")}`.toLowerCase()
|
||||
url = `/${url.replace(URL_REGEX_SLASH, "")}`.toLowerCase()
|
||||
const hostingInfo = await getHostingInfo()
|
||||
if (hostingInfo.type === HostingTypes.CLOUD) {
|
||||
return url
|
||||
|
|
|
@ -3,6 +3,7 @@ const CouchDB = require("../../db")
|
|||
const env = require("../../environment")
|
||||
|
||||
const APP_PREFIX = "app_"
|
||||
const URL_REGEX_SLASH = /\/|\\/g
|
||||
|
||||
exports.getApps = async ctx => {
|
||||
let allDbs
|
||||
|
@ -18,7 +19,7 @@ exports.getApps = async ctx => {
|
|||
const body = {}
|
||||
for (let app of apps) {
|
||||
let url = app.url || encodeURI(`${app.name}`)
|
||||
url = `/${url.replace(/\/|\\/g, "")}`
|
||||
url = `/${url.replace(URL_REGEX_SLASH, "")}`
|
||||
body[url] = {
|
||||
appId: app._id,
|
||||
name: app.name,
|
||||
|
|
Loading…
Reference in New Issue