Fixing issue with applications not being created due to a lack of template file.

This commit is contained in:
mike12345567 2021-03-16 13:43:46 +00:00
parent 05b6e825b4
commit f114f68021
1 changed files with 6 additions and 3 deletions

View File

@ -162,11 +162,14 @@ exports.fetchAppPackage = async function(ctx) {
exports.create = async function(ctx) {
const { useTemplate, templateKey } = ctx.request.body
const instance = await createInstance({
const instanceConfig = {
useTemplate,
key: templateKey,
file: ctx.request.files.templateFile,
})
}
if (ctx.request.files && ctx.request.files.templateFile) {
instanceConfig.file = ctx.request.files.templateFile
}
const instance = await createInstance(instanceConfig)
const url = await getAppUrlIfNotInUse(ctx)
const appId = instance._id