mirror of
https://github.com/zhigang1992/firebase-tools.git
synced 2026-04-30 21:02:13 +08:00
Fix issue 1069
This commit is contained in:
@@ -103,6 +103,10 @@ export class FirestoreIndexes {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const indexes = res.body.indexes;
|
const indexes = res.body.indexes;
|
||||||
|
if (!indexes) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
return indexes.map(
|
return indexes.map(
|
||||||
(index: any): API.Index => {
|
(index: any): API.Index => {
|
||||||
// Ignore any fields that point at the document ID, as those are implied
|
// Ignore any fields that point at the document ID, as those are implied
|
||||||
@@ -136,6 +140,12 @@ export class FirestoreIndexes {
|
|||||||
|
|
||||||
const fields = res.body.fields as API.Field[];
|
const fields = res.body.fields as API.Field[];
|
||||||
|
|
||||||
|
// This should never be the case, since the API always returns the __default__
|
||||||
|
// configuration, but this is a defensive check.
|
||||||
|
if (!fields) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// Ignore the default config, only list other fields.
|
// Ignore the default config, only list other fields.
|
||||||
return fields.filter((field) => {
|
return fields.filter((field) => {
|
||||||
return field.name.indexOf("__default__") < 0;
|
return field.name.indexOf("__default__") < 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user