fix deployed issue

This commit is contained in:
faris Aljohari
2025-07-03 01:12:23 -06:00
parent a9eaf44d31
commit 60bc03cf79

View File

@ -1,7 +1,5 @@
import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { TuyaContext } from '@tuya/tuya-connector-nodejs'; import { TuyaContext } from '@tuya/tuya-connector-nodejs';
import { import {
AddScheduleDto, AddScheduleDto,
@ -13,7 +11,6 @@ import {
getDeviceScheduleInterface, getDeviceScheduleInterface,
} from '../interfaces/get.schedule.interface'; } from '../interfaces/get.schedule.interface';
import { ProductType } from '@app/common/constants/product-type.enum';
import { ProductType } from '@app/common/constants/product-type.enum'; import { ProductType } from '@app/common/constants/product-type.enum';
import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter'; import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter';
import { convertTimestampToDubaiTime } from '@app/common/helper/convertTimestampToDubaiTime'; import { convertTimestampToDubaiTime } from '@app/common/helper/convertTimestampToDubaiTime';
@ -22,7 +19,6 @@ import {
getScheduleStatus, getScheduleStatus,
} from '@app/common/helper/getScheduleStatus'; } from '@app/common/helper/getScheduleStatus';
import { DeviceRepository } from '@app/common/modules/device/repositories'; import { DeviceRepository } from '@app/common/modules/device/repositories';
import { DeviceRepository } from '@app/common/modules/device/repositories';
@Injectable() @Injectable()
export class ScheduleService { export class ScheduleService {
@ -128,7 +124,6 @@ export class ScheduleService {
deviceDetails.deviceTuyaUuid, deviceDetails.deviceTuyaUuid,
addScheduleDto, addScheduleDto,
deviceDetails.productDevice.prodType as ProductType, deviceDetails.productDevice.prodType as ProductType,
deviceDetails.productDevice.prodType as ProductType,
); );
} catch (error) { } catch (error) {
throw new HttpException( throw new HttpException(
@ -152,14 +147,9 @@ export class ScheduleService {
deviceDetails.deviceTuyaUuid, deviceDetails.deviceTuyaUuid,
category, category,
deviceDetails.productDevice.prodType as ProductType, deviceDetails.productDevice.prodType as ProductType,
deviceDetails.productDevice.prodType as ProductType,
); );
const result = schedules.result.map((schedule: any) => { const result = schedules.result.map((schedule: any) => {
return { return {
category:
deviceDetails.productDevice.prodType == ProductType.CUR_2
? schedule.category
: schedule.category.replace('category_', ''),
category: category:
deviceDetails.productDevice.prodType == ProductType.CUR_2 deviceDetails.productDevice.prodType == ProductType.CUR_2
? schedule.category ? schedule.category
@ -223,7 +213,6 @@ export class ScheduleService {
deviceDetails.deviceTuyaUuid, deviceDetails.deviceTuyaUuid,
updateScheduleDto, updateScheduleDto,
deviceDetails.productDevice.prodType as ProductType, deviceDetails.productDevice.prodType as ProductType,
deviceDetails.productDevice.prodType as ProductType,
); );
} catch (error) { } catch (error) {
throw new HttpException( throw new HttpException(
@ -313,7 +302,6 @@ export class ScheduleService {
deviceId: string, deviceId: string,
updateScheduleDto: UpdateScheduleDto, updateScheduleDto: UpdateScheduleDto,
deviceType: ProductType, deviceType: ProductType,
deviceType: ProductType,
): Promise<addScheduleDeviceInterface> { ): Promise<addScheduleDeviceInterface> {
try { try {
const convertedTime = convertTimestampToDubaiTime(updateScheduleDto.time); const convertedTime = convertTimestampToDubaiTime(updateScheduleDto.time);