Browse Source

Review comments.

pull/996/head
mike12345567 5 years ago
parent
commit
fcde592385
  1. 1
      packages/builder/src/components/settings/tabs/General.svelte
  2. 4
      packages/server/src/api/controllers/application.js
  3. 3
      packages/worker/src/api/controllers/app.js

1
packages/builder/src/components/settings/tabs/General.svelte

@ -62,7 +62,6 @@
if (urlIdx !== -1) {
existingAppUrls.splice(urlIdx, 1)
}
console.log(existingAppUrls)
nameValidation = {
name: string()
.required(nameError)

4
packages/server/src/api/controllers/application.js

@ -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
packages/worker/src/api/controllers/app.js

@ -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…
Cancel
Save