fix: allow app creation without JAR when deploy is disabled
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m21s
CI / docker (push) Successful in 1m7s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 36s

canSubmit no longer requires a JAR file when "Create only" is selected.
JAR upload and deploy steps are skipped when no file is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-15 20:38:53 +02:00
parent 457650012b
commit e4b8f1bab4

View File

@@ -251,7 +251,7 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
if (p && !ports.includes(p)) { setPorts([...ports, p]); setNewPort(''); }
}
const canSubmit = name.trim() && slug.trim() && envId && file;
const canSubmit = name.trim() && slug.trim() && envId && (file || !deploy);
async function handleSubmit() {
if (!canSubmit) return;
@@ -261,9 +261,12 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
setStep('Creating app...');
const app = await createApp.mutateAsync({ environmentId: envId, slug: slug.trim(), displayName: name.trim() });
// 2. Upload JAR
setStep('Uploading JAR...');
const version = await uploadJar.mutateAsync({ appId: app.slug, file: file! });
// 2. Upload JAR (if provided)
let version: AppVersion | null = null;
if (file) {
setStep('Uploading JAR...');
version = await uploadJar.mutateAsync({ appId: app.slug, file });
}
// 3. Save container config
setStep('Saving configuration...');
@@ -307,8 +310,8 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
environment: selectedEnv,
});
// 5. Deploy (if requested)
if (deploy) {
// 5. Deploy (if requested and JAR was uploaded)
if (deploy && version) {
setStep('Starting deployment...');
await createDeployment.mutateAsync({ appId: app.slug, appVersionId: version.id, environmentId: envId });
}