Skip to content

Commit

Permalink
use of some constants in command
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Sep 14, 2024
1 parent 615ba66 commit d722fa4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions generators/spring-boot/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand All @@ -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,
}),
Expand Down

0 comments on commit d722fa4

Please sign in to comment.