From 44779915f62fc84a851d7d1febc21c587ffd999e Mon Sep 17 00:00:00 2001 From: carlosbloqhouse Date: Mon, 23 Dec 2024 23:54:58 +0100 Subject: [PATCH] fix: correct resourcesNames in get log queries --- src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c116f139..3a4095e0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -593,7 +593,7 @@ class Logging { reqOpts.resourceNames = arrify(reqOpts.resourceNames!); this.projectId = await this.auth.getProjectId(); const resourceName = 'projects/' + this.projectId; - if (reqOpts.resourceNames.indexOf(resourceName) === -1) { + if (reqOpts.resourceNames.length < 1) { reqOpts.resourceNames.push(resourceName); } delete reqOpts.autoPaginate; @@ -692,7 +692,9 @@ class Logging { options ); reqOpts.resourceNames = arrify(reqOpts.resourceNames!); - reqOpts.resourceNames.push(`projects/${this.projectId}`); + if (reqOpts.resourceNames.length < 1) { + reqOpts.resourceNames.push(`projects/${this.projectId}`); + } delete reqOpts.autoPaginate; delete reqOpts.gaxOptions; const gaxOptions = extend(