auto name template based apps
This commit is contained in:
parent
90934c547f
commit
5313e27797
|
@ -98,10 +98,12 @@
|
||||||
|
|
||||||
const autoCreateApp = async () => {
|
const autoCreateApp = async () => {
|
||||||
try {
|
try {
|
||||||
// TODO: Iterate App Names and append a number
|
// Auto name app if has same name
|
||||||
const appName = template.key + Math.floor(Math.random() * 100)
|
let appName = template.key
|
||||||
|
const appsWithSameName = $apps.filter(app =>
|
||||||
console.log("APP NAME", appName)
|
app.name?.startsWith(appName)
|
||||||
|
)
|
||||||
|
appName = `${appName}-${appsWithSameName.length + 1}`
|
||||||
|
|
||||||
// Create form data to create app
|
// Create form data to create app
|
||||||
let data = new FormData()
|
let data = new FormData()
|
||||||
|
@ -120,6 +122,7 @@
|
||||||
name: appName,
|
name: appName,
|
||||||
appId: appJson.instance._id,
|
appId: appJson.instance._id,
|
||||||
template,
|
template,
|
||||||
|
fromTemplateMarketplace: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Select Correct Application/DB in prep for creating user
|
// Select Correct Application/DB in prep for creating user
|
||||||
|
|
Loading…
Reference in New Issue