Skip to content

Commit

Permalink
feat(projects): improve variable naming for better readability (#21903)
Browse files Browse the repository at this point in the history
Update variable names in 'projects.ts'. Change 'block_vpc_connections' and
'block_public_connections' to 'blockVpcConnections' and
'blockPublicConnections' respectively. Also update the usage instructions
for these variables in their descriptions.
  • Loading branch information
chaporgin committed Jan 31, 2025
1 parent 714f08b commit 239cd08
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/commands/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,18 @@ export const builder = (argv: yargs.Argv) => {
'Update a project',
(yargs) =>
yargs.options({
block_vpc_connections: {
'block-vpc-connections': {
describe:
projectUpdateRequest['project.settings.block_vpc_connections']
.description,
.description +
' Use --block-vpc-connections=false to set the value to false.',
type: 'boolean',
},
block_public_connections: {
'block-public-connections': {
describe:
projectUpdateRequest['project.settings.block_public_connections']
.description,
.description +
' Use --block-public-connections=false to set the value to false.',
type: 'boolean',
},
cu: {
Expand Down Expand Up @@ -285,22 +287,22 @@ const update = async (
IdOrNameProps & {
name?: string;
cu?: string;
block_vpc_connections?: boolean;
block_public_connections?: boolean;
blockVpcConnections?: boolean;
blockPublicConnections?: boolean;
},
) => {
const project: ProjectUpdateRequest['project'] = {};
if (props.block_public_connections !== undefined) {
if (props.blockPublicConnections !== undefined) {
if (!project.settings) {
project.settings = {};
}
project.settings.block_public_connections = props.block_public_connections;
project.settings.block_public_connections = props.blockPublicConnections;
}
if (props.block_vpc_connections !== undefined) {
if (props.blockVpcConnections !== undefined) {
if (!project.settings) {
project.settings = {};
}
project.settings.block_vpc_connections = props.block_vpc_connections;
project.settings.block_vpc_connections = props.blockVpcConnections;
}
if (props.name) {
project.name = props.name;
Expand Down

0 comments on commit 239cd08

Please sign in to comment.