Switch to balenaApi for the state patch as patching cannot be cached

Change-type: patch
This commit is contained in:
Pagan Gazzard 2020-05-18 15:12:52 +01:00 committed by Balena CI
parent 5f35331633
commit fb90042c39

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.