dont allow examples when api is none (#243)

This commit is contained in:
Aman Varshney
2025-05-10 22:28:05 +05:30
committed by GitHub
parent 2924b817a3
commit 6a339bca1f
12 changed files with 188 additions and 241 deletions

View File

@@ -2,6 +2,7 @@ import { cancel, isCancel, multiselect } from "@clack/prompts";
import pc from "picocolors";
import { DEFAULT_CONFIG } from "../constants";
import type {
ProjectApi,
ProjectBackend,
ProjectDatabase,
ProjectExamples,
@@ -13,7 +14,11 @@ export async function getExamplesChoice(
database?: ProjectDatabase,
frontends?: ProjectFrontend[],
backend?: ProjectBackend,
api?: ProjectApi,
): Promise<ProjectExamples[]> {
if (api === "none") {
return [];
}
if (examples !== undefined) return examples;
if (backend === "convex") {