mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
Add productUuid to response in getDeviceDetails method
This commit is contained in:
@ -239,11 +239,18 @@ export class DeviceService {
|
||||
|
||||
// Convert keys to camel case
|
||||
const camelCaseResponse = convertKeysToCamelCase(response);
|
||||
const deviceDetails = await this.deviceRepository.findOne({
|
||||
where: {
|
||||
deviceTuyaUuid: deviceId,
|
||||
},
|
||||
relations: ['productDevice'],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { productName, productId, ...rest } = camelCaseResponse.result;
|
||||
return {
|
||||
...rest,
|
||||
productUuid: deviceDetails.productDevice.uuid,
|
||||
} as GetDeviceDetailsInterface;
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
|
Reference in New Issue
Block a user