stripping - from additional app name number
This commit is contained in:
parent
a4c04fd329
commit
67bfa63861
|
@ -167,11 +167,13 @@
|
||||||
const autoCreateApp = async () => {
|
const autoCreateApp = async () => {
|
||||||
try {
|
try {
|
||||||
// Auto name app if has same name
|
// Auto name app if has same name
|
||||||
let appName = template.key.replace("app/", "")
|
const templateKey = template.key.split("/")[1]
|
||||||
|
|
||||||
|
let appName = templateKey.replace(/-/g, " ")
|
||||||
const appsWithSameName = $apps.filter(app =>
|
const appsWithSameName = $apps.filter(app =>
|
||||||
app.name?.startsWith(appName)
|
app.name?.startsWith(appName)
|
||||||
)
|
)
|
||||||
appName = `${appName}-${appsWithSameName.length + 1}`
|
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()
|
||||||
|
|
Loading…
Reference in New Issue