mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 09:14:54 +00:00
renamed dtos
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
export class CreateSpaceProductItemModelDto {
|
||||
export class CreateProductItemModelDto {
|
||||
@ApiProperty({
|
||||
description: 'Specific name for the product item',
|
||||
example: 'Light 1',
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
ArrayNotEmpty,
|
||||
} from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { CreateSpaceProductItemModelDto } from './create-space-product-item-model.dto';
|
||||
import { CreateProductItemModelDto } from './create-space-product-item-model.dto';
|
||||
|
||||
export class CreateSpaceProductModelDto {
|
||||
@ApiProperty({
|
||||
@ -29,11 +29,11 @@ export class CreateSpaceProductModelDto {
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Specific names for each product item',
|
||||
type: [CreateSpaceProductItemModelDto],
|
||||
type: [CreateProductItemModelDto],
|
||||
})
|
||||
@IsArray()
|
||||
@ArrayNotEmpty()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => CreateSpaceProductItemModelDto)
|
||||
items: CreateSpaceProductItemModelDto[];
|
||||
@Type(() => CreateProductItemModelDto)
|
||||
items: CreateProductItemModelDto[];
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
SpaceProductModelEntity,
|
||||
} from '@app/common/modules/space-model';
|
||||
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||
import { CreateSpaceProductItemModelDto } from '../dtos';
|
||||
import { CreateProductItemModelDto } from '../dtos';
|
||||
import { QueryRunner } from 'typeorm';
|
||||
|
||||
@Injectable()
|
||||
@ -14,7 +14,7 @@ export class SpaceProductItemModelService {
|
||||
) {}
|
||||
|
||||
async createProdutItemModel(
|
||||
itemModelDtos: CreateSpaceProductItemModelDto[],
|
||||
itemModelDtos: CreateProductItemModelDto[],
|
||||
spaceProductModel: SpaceProductModelEntity,
|
||||
spaceModel: SpaceModelEntity,
|
||||
queryRunner: QueryRunner,
|
||||
@ -43,7 +43,7 @@ export class SpaceProductItemModelService {
|
||||
}
|
||||
|
||||
private async validateTags(
|
||||
itemModelDtos: CreateSpaceProductItemModelDto[],
|
||||
itemModelDtos: CreateProductItemModelDto[],
|
||||
queryRunner: QueryRunner,
|
||||
spaceModel: SpaceModelEntity,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user