Skip to content

Commit 53f74a8

Browse files
committed
feat: Include product type in the response of getProductById
1 parent 4e0efb5 commit 53f74a8

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import { Category } from '@prisma/client';
2-
3-
import { ApiProperty, PickType } from '@nestjs/swagger';
4-
5-
import { GetCategoriesDTO } from 'src/modules/category/dto/get.category.dto';
1+
import { PickType } from '@nestjs/swagger';
62

73
import { ProductDTO } from './product.dto';
84

@@ -11,7 +7,5 @@ export class SearchProductDTO extends PickType(ProductDTO, [
117
'name',
128
'image',
139
'currentAmount',
14-
]) {
15-
@ApiProperty({ description: '카테고리', type: [GetCategoriesDTO] })
16-
categories: Category[];
17-
}
10+
'type',
11+
]) {}

src/modules/product/product.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ export class ProductService {
318318
id: true,
319319
name: true,
320320
image: true,
321+
type: true,
321322
currentAmount: true,
322-
categories: true,
323323
},
324324
});
325325
}

0 commit comments

Comments
 (0)