From d722fa47393943f94f630792ba5dd544a848358c Mon Sep 17 00:00:00 2001 From: Charlie Mordant Date: Sat, 14 Sep 2024 23:04:08 +0200 Subject: [PATCH] use of some constants in command --- generators/spring-boot/command.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generators/spring-boot/command.ts b/generators/spring-boot/command.ts index 6dca0cd0903a..2850faf0a908 100644 --- a/generators/spring-boot/command.ts +++ b/generators/spring-boot/command.ts @@ -23,7 +23,7 @@ import { createBase64Secret, createSecret } from '../base/support/secret.js'; import { applicationTypes, authenticationTypes } from '../../lib/jhipster/index.js'; const { OAUTH2, SESSION, JWT } = authenticationTypes; -const { GATEWAY, MICROSERVICE } = applicationTypes; +const { GATEWAY, MICROSERVICE, MONOLITH } = applicationTypes; const command = { options: { @@ -70,7 +70,7 @@ const command = { type: String, }, prompt: gen => ({ - when: () => ['gateway', 'microservice'].includes(gen.jhipsterConfigWithDefaults.applicationType), + when: () => [GATEWAY, MICROSERVICE].includes(gen.jhipsterConfigWithDefaults.applicationType), type: 'list', message: 'Which service discovery server do you want to use?', default: 'consul', @@ -92,8 +92,8 @@ const command = { type: 'list', message: `Which ${chalk.yellow('*type*')} of authentication would you like to use?`, choices: () => - gen.jhipsterConfigWithDefaults.applicationType !== 'monolith' - ? (config.choices as any).filter(({ value }) => value !== 'session') + gen.jhipsterConfigWithDefaults.applicationType !== MONOLITH + ? (config.choices as any).filter(({ value }) => value !== SESSION) : config.choices, default: () => gen.jhipsterConfigWithDefaults.authenticationType, }),