Send url to api and honour url on viewing published app

This commit is contained in:
Rory Powell 2022-01-20 17:27:56 +00:00
parent 6e5957a01a
commit 58bcba71f7
3 changed files with 26 additions and 769 deletions

View File

@ -31,7 +31,13 @@
async function updateApp() {
try {
// Update App
await apps.update(app.instance._id, { name: $values.name.trim() })
const body = {
name: $values.name.trim(),
}
if ($values.url) {
body.url = $values.url.trim()
}
await apps.update(app.instance._id, body)
} catch (error) {
console.error(error)
notifications.error(error)

View File

@ -80,7 +80,7 @@
}
const initiateAppCreation = () => {
template = {}
template = null
creationModal.show()
creatingApp = true
}
@ -164,7 +164,7 @@
const viewApp = app => {
if (!isCloud && app.deployed) {
// special case to use the short form name if self hosted
window.open(`/app/${encodeURIComponent(app.name)}`)
window.open(`/app${app.url}`)
} else {
const id = app.deployed ? app.prodId : app.devId
window.open(`/${id}`, "_blank")

File diff suppressed because it is too large Load Diff