Skip to content
Permalink
Browse files

Ask for readOnly in entity subgen prompt

  • Loading branch information...
murdos committed Oct 9, 2019
1 parent 33f6d87 commit 35388c019fdce24298e2f6af9e859067822235d6
Showing with 19 additions and 0 deletions.
  1. +1 −0 generators/entity/index.js
  2. +18 −0 generators/entity/prompts.js
@@ -362,6 +362,7 @@ class EntityGenerator extends BaseBlueprintGenerator {
askForService: prompts.askForService,
askForDTO: prompts.askForDTO,
askForFiltering: prompts.askForFiltering,
askForReadOnly: prompts.askForReadOnly,
askForPagination: prompts.askForPagination
};
}
@@ -33,6 +33,7 @@ module.exports = {
askForDTO,
askForService,
askForFiltering,
askForReadOnly,
askForPagination
};

@@ -324,6 +325,23 @@ function askForFiltering() {
});
}

function askForReadOnly() {
const context = this.context;
const done = this.async();
const prompts = [
{
type: 'confirm',
name: 'readOnly',
message: 'Is this entity read-only?',
default: false
}
];
this.prompt(prompts).then(props => {
context.readOnly = props.readOnly;
done();
});
}

function askForDTO() {
const context = this.context;
// don't prompt if data is imported from a file or server is skipped or if no service layer

0 comments on commit 35388c0

Please sign in to comment.
You can’t perform that action at this time.