Skip to content

Commit fbd10ef

Browse files
committed
fix: Show Organizations and Projects instead of an object
1 parent e8248bc commit fbd10ef

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

templates/cli/lib/commands/init.js.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ const initProject = async ({ organizationId, projectId, projectName } = {}) => {
5353
answers.project = {};
5454
answers.organization = {};
5555

56-
answers.organization.id = organizationId ?? (await inquirer.prompt(questionsInitProject[2])).organization;
56+
answers.organization = organizationId ?? (await inquirer.prompt(questionsInitProject[2])).organization;
5757
answers.project.name = projectName ?? (await inquirer.prompt(questionsInitProject[3])).project;
58-
answers.project.id = projectId ?? (await inquirer.prompt(questionsInitProject[4])).id;
58+
answers.project = projectId ?? (await inquirer.prompt(questionsInitProject[4])).id;
5959

6060
try {
6161
await projectsGet({ projectId, parseOutput: false });
6262
} catch (e) {
6363
if (e.code === 404) {
6464
answers.start = 'new';
65-
answers.id = answers.project.id;
65+
answers.id = answers.project;
6666
answers.project = answers.project.name;
6767
} else {
6868
throw e;
@@ -74,7 +74,7 @@ const initProject = async ({ organizationId, projectId, projectName } = {}) => {
7474
response = await projectsCreate({
7575
projectId: answers.id,
7676
name: answers.project,
77-
teamId: answers.organization.id,
77+
teamId: answers.organization,
7878
parseOutput: false
7979
})
8080

templates/cli/lib/questions.js.twig

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ const questionsInitProject = [
155155
let choices = teams.map((team, idx) => {
156156
return {
157157
name: `${team.name} (${team['$id']})`,
158-
value: {
159-
name: team.name,
160-
id: team['$id']
161-
}
158+
value: team['$id']
162159
}
163160
})
164161

@@ -199,10 +196,7 @@ const questionsInitProject = [
199196
let choices = projects.map((project) => {
200197
return {
201198
name: `${project.name} (${project['$id']})`,
202-
value: {
203-
name: project.name,
204-
id: project['$id']
205-
}
199+
value: project['$id']
206200
}
207201
})
208202

0 commit comments

Comments
 (0)