Skip to content

Commit 38ddf48

Browse files
committed
refactoring(cli): adding pagination and const the variable
1 parent 3cf8f7b commit 38ddf48

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

templates/cli/lib/questions.js.twig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { teamsList } = require('./commands/teams');
44
const { functionsListRuntimes } = require('./commands/functions');
55
const { accountListMfaFactors } = require("./commands/account");
66
const { sdkForConsole } = require("./sdks");
7+
const { paginate } = require('./paginate');
78

89
const { databasesList } = require('./commands/databases');
910
const JSONbig = require("json-bigint")({ storeAsString: false });
@@ -124,12 +125,8 @@ const questionsInitProject = [
124125
message: "Choose the project organization",
125126
choices: async () => {
126127
let client = await sdkForConsole(true);
128+
const { teams } = await paginate(teamsList, { parseOutput: false , sdk: client}, 100, 'teams');
127129

128-
let response = await teamsList({
129-
parseOutput: false,
130-
sdk: client
131-
})
132-
let teams = response["teams"]
133130
let choices = teams.map((team, idx) => {
134131
return {
135132
name: `${team.name} (${team['$id']})`,

0 commit comments

Comments
 (0)