Use bracket notation to access search builds

Using dot notation causes downstream ts compile to fail.

Bug: 1349634
Change-Id: I08c92df00a2798487dd5ba0ab0e610bcce26ec77
Reviewed-on: https://chromium-review.googlesource.com/c/infra/gerrit-plugins/buildbucket/+/5245947
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
diff --git a/web/checks-fetcher.ts b/web/checks-fetcher.ts
index 6af0921..2a23001 100644
--- a/web/checks-fetcher.ts
+++ b/web/checks-fetcher.ts
@@ -539,7 +539,7 @@
       const newRequests: SearchBuildsRequest[] = [];
       (responses || []).forEach((response: IndividualBatchResponse, i: number) => {
         if (response.hasOwnProperty('error')) {
-          const error = response.error as RequestStatus;
+          const error = response['error'] as RequestStatus;
           console.error(
             'Buildbucket request failed with error code ' +
               `${error.code}: ${error.message}`
@@ -547,7 +547,7 @@
           return;
         }
 
-        const searchBuilds = response.searchBuilds as SearchBuildsResponse;
+        const searchBuilds = response['searchBuilds'] as SearchBuildsResponse;
         builds.push(...(searchBuilds.builds || []));
 
         // If there are more builds to fetch, add the request to be re-fetched.