Skip to content

Commit a70b09a

Browse files
committed
Added check to see if projectId is valid
1 parent 6366115 commit a70b09a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/firestore-indexes-list.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Emulators } from "../emulator/types";
88
import { warnEmulatorNotSupported } from "../emulator/commandUtils";
99
import { FirestoreOptions } from "../firestore/options";
1010
import { PrettyPrint } from "../firestore/pretty-print";
11+
import { needProjectId } from "../projectUtils";
1112

1213
export const command = new Command("firestore:indexes")
1314
.description("List indexes in your project's Cloud Firestore database.")
@@ -27,8 +28,9 @@ export const command = new Command("firestore:indexes")
2728
const printer = new PrettyPrint();
2829

2930
const databaseId = options.database ?? "(default)";
30-
const indexes = await indexApi.listIndexes(options.project, databaseId);
31-
const fieldOverrides = await indexApi.listFieldOverrides(options.project, databaseId);
31+
const projectId = needProjectId(options);
32+
const indexes = await indexApi.listIndexes(projectId, databaseId);
33+
const fieldOverrides = await indexApi.listFieldOverrides(projectId, databaseId);
3234

3335
const indexSpec = indexApi.makeIndexSpec(indexes, fieldOverrides);
3436

0 commit comments

Comments
 (0)