Reputation: 11
const { selectedTodolistId } = await inquirer.createPromptModule()([
{
type: 'list',
name: 'selectedTodolistId',
message: 'Select Proofhub Todolist:',
choices: todolistChoices,
}
],);
tasksResponse.data.forEach((task:any) => {
const { title, id, completed,project } = task;
const color = completed ?clc.green:clc.green
projectId=project.id;
taskOptions.push({
name: color(title).toString(),
value: id,
});
taskIndex++;
});
const { selectedTaskIndex: selectedTaskValue } = await inquirer.prompt([
{
type: 'search-list',
name: 'selectedTaskIndex',
message: 'Select a task:',
choices: taskOptions,
},
]);
I've got this thing where I want to see the names in the console, just like that createPromptModule does it. but also need to grab ID details from selectedTaskValue. It's showing Id in the console,. How do I get the name to show in the terminal.I need to get the name out of it. Currently Im using inquirer as search-list.
I've got this thing where I want to see the names in the console, just like that createPromptModule does it. but also need to grab ID details from selectedTaskValue. It's showing Id in the console,. How do I get the name to show in the terminal.I need to get the name out of it. Currently Im using inquirer as search-list.
Upvotes: 1
Views: 70