removed guards

This commit is contained in:
hannathkadher
2024-10-30 22:47:03 +04:00
parent 1f0cedfd09
commit b0ea7cdc25
5 changed files with 18 additions and 26 deletions
@@ -155,11 +155,9 @@ export class SubspaceDeviceService {
deviceId: string,
): Promise<GetDeviceDetailsInterface> {
try {
// Fetch details from TuyaService
const tuyaDeviceDetails =
await this.tuyaService.getDeviceDetails(deviceId);
// Convert keys to camel case
const camelCaseResponse = convertKeysToCamelCase(tuyaDeviceDetails);
const product = await this.productRepository.findOne({
@@ -168,8 +166,7 @@ export class SubspaceDeviceService {
},
});
// Exclude specific keys and add `productUuid`
const { ...rest } = camelCaseResponse;
const { uuid, ...rest } = camelCaseResponse;
return {
...rest,
productUuid: product?.uuid,