Cleaning-up EtcherPro specific code

This commit is contained in:
Aurelien VALADE 2023-01-12 14:52:08 +01:00
parent d25eda9a7d
commit 45f6ee667d

View File

@ -16,6 +16,12 @@
import { Dictionary } from 'lodash'; import { Dictionary } from 'lodash';
type BalenaTag = {
id: number,
name: string,
value: string
}
export class EtcherPro { export class EtcherPro {
private supervisorAddr: string; private supervisorAddr: string;
private supervisorKey: string; private supervisorKey: string;
@ -38,12 +44,12 @@ export class EtcherPro {
if (parsed['status'] === 'success') { if (parsed['status'] === 'success') {
return Object.assign( return Object.assign(
{}, {},
...parsed['tags'].map((tag: any) => { ...parsed['tags'].map((tag: BalenaTag) => {
return { [tag.name]: tag['value'] }; return { [tag.name]: tag.value };
}), }),
); );
} else { } else {
return await {}; return {};
} }
} }