1
0
Fork 0
mirror of synced 2024-07-02 04:50:44 +12:00

auto name template based apps

This commit is contained in:
Martin McKeaveney 2021-11-25 13:00:21 +01:00
parent e7e41a1743
commit cf062034f6

View file

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