mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 15:27:54 +00:00
removed guards
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user