Merge pull request #1334 from balena-io/patch-balena-api

Switch to balenaApi for the state patch as patching cannot be cached
This commit is contained in:
Page- 2020-05-18 20:38:10 +01:00 committed by GitHub
commit 9c25b09696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,7 +456,7 @@ export class APIBinder {
stateDiff: DeviceStatus,
conf: { apiEndpoint: string; uuid: string; localMode: boolean },
) {
if (this.cachedBalenaApi == null) {
if (this.balenaApi == null) {
throw new InternalInconsistencyError(
'Attempt to send report patch without an API client',
);
@ -483,10 +483,10 @@ export class APIBinder {
url: endpoint,
body,
},
this.cachedBalenaApi.passthrough,
this.balenaApi.passthrough,
);
await this.cachedBalenaApi._request(requestParams);
await this.balenaApi._request(requestParams);
}
// Returns an object that contains only status fields relevant for the local mode.