feat(*.liquid): apply prettier to liquid templates
- offer to create tag when none is found while adding a link from cli - fix tag display in search
This commit is contained in:
parent
49e21d574e
commit
efe701f939
112 changed files with 1319 additions and 1134 deletions
|
@ -1,12 +1,12 @@
|
|||
import inquirer from 'inquirer';
|
||||
import { searchItems } from '../directus/client.js';
|
||||
import inquirer from "inquirer";
|
||||
import { searchItems } from "../directus/client.js";
|
||||
|
||||
export const promptForMultipleRelations = async (collection, label = collection) => {
|
||||
const selectedIds = new Set();
|
||||
|
||||
while (true) {
|
||||
const { query } = await inquirer.prompt({
|
||||
name: 'query',
|
||||
name: "query",
|
||||
message: `🔍 Search ${label} (or leave blank to finish):`
|
||||
});
|
||||
const trimmed = query.trim();
|
||||
|
@ -22,8 +22,8 @@ export const promptForMultipleRelations = async (collection, label = collection)
|
|||
}
|
||||
|
||||
const { selected } = await inquirer.prompt({
|
||||
type: 'checkbox',
|
||||
name: 'selected',
|
||||
type: "checkbox",
|
||||
name: "selected",
|
||||
message: `✔ Select ${label} to add:`,
|
||||
choices: results.map((item) => ({
|
||||
name: item.name || item.title || item.id,
|
||||
|
@ -34,8 +34,8 @@ export const promptForMultipleRelations = async (collection, label = collection)
|
|||
selected.forEach((id) => selectedIds.add(id));
|
||||
|
||||
const { again } = await inquirer.prompt({
|
||||
type: 'confirm',
|
||||
name: 'again',
|
||||
type: "confirm",
|
||||
name: "again",
|
||||
message: `Search and add more ${label}?`,
|
||||
default: false
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue