mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 18:27:05 +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
|
// Convert keys to camel case
|
||||||
const camelCaseResponse = convertKeysToCamelCase(response);
|
const camelCaseResponse = convertKeysToCamelCase(response);
|
||||||
|
const deviceDetails = await this.deviceRepository.findOne({
|
||||||
|
where: {
|
||||||
|
deviceTuyaUuid: deviceId,
|
||||||
|
},
|
||||||
|
relations: ['productDevice'],
|
||||||
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const { productName, productId, ...rest } = camelCaseResponse.result;
|
const { productName, productId, ...rest } = camelCaseResponse.result;
|
||||||
return {
|
return {
|
||||||
...rest,
|
...rest,
|
||||||
|
productUuid: deviceDetails.productDevice.uuid,
|
||||||
} as GetDeviceDetailsInterface;
|
} as GetDeviceDetailsInterface;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
|
Reference in New Issue
Block a user