Remove unused patchDevice function

This function was a remainder of the dependent devices code that no
was removed on #2105

Change-type: patch
This commit is contained in:
Felipe Lalanne 2024-08-29 10:34:43 -04:00
parent 5a1c81a408
commit 788afee9a1
No known key found for this signature in database
GPG Key ID: 03E696BFD472B26A

View File

@ -1,4 +1,3 @@
import Bluebird from 'bluebird';
import { stripIndent } from 'common-tags';
import { isLeft } from 'fp-ts/lib/Either';
import * as t from 'io-ts';
@ -198,35 +197,6 @@ export async function start() {
}
}
export async function patchDevice(
id: number,
updatedFields: Dictionary<unknown>,
) {
const conf = await config.getMany(['unmanaged', 'provisioned', 'apiTimeout']);
if (conf.unmanaged) {
throw new Error('Cannot update device in unmanaged mode');
}
if (!conf.provisioned) {
throw new Error('Device must be provisioned to update a device');
}
if (balenaApi == null) {
throw new InternalInconsistencyError(
'Attempt to patch device without an API client',
);
}
return Bluebird.resolve(
balenaApi.patch({
resource: 'device',
id,
body: updatedFields,
}),
).timeout(conf.apiTimeout);
}
export function startCurrentStateReport() {
if (balenaApi == null) {
throw new InternalInconsistencyError(