Skip to content

Commit

Permalink
feature:FUR-9 [BE][Management]Update modelId to modelUrl field
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhhTien committed May 18, 2024
1 parent a65f4ff commit 2305875
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/product/dto/product.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export class PublicProductDto {
images: string[]

@ApiProperty({
example: '70c55cac-9d45-49e6-8094-0c74c749fd25'
example: 'https://res.cloudinary.com/drta9lo35/image/upload/v1715929846/knmgqbnkllurf88xxd3b.glb'
})
modelId: string
modelUrl: string

@ApiProperty({ type: Category, isArray: true })
categories: Category[]
Expand Down Expand Up @@ -80,11 +80,11 @@ export class CreateProductDto {
images: string[]

@ApiPropertyOptional({
example: '70c55cac-9d45-49e6-8094-0c74c749fd25'
example: 'https://res.cloudinary.com/drta9lo35/image/upload/v1715929846/knmgqbnkllurf88xxd3b.glb'
})
@IsOptional()
@IsString()
modelId?: string
modelUrl?: string

@ApiProperty({
example: 'ERYE'
Expand Down Expand Up @@ -130,11 +130,11 @@ export class UpdateProductDto {
images: string[]

@ApiPropertyOptional({
example: '70c55cac-9d45-49e6-8094-0c74c749fd25'
example: 'https://res.cloudinary.com/drta9lo35/image/upload/v1715929846/knmgqbnkllurf88xxd3b.glb'
})
@IsOptional()
@IsString()
modelId?: string
modelUrl?: string

@ApiProperty({
example: 'ERYE'
Expand Down Expand Up @@ -173,9 +173,9 @@ export class ProductDetailDto {
images: string[]

@ApiPropertyOptional({
example: '70c55cac-9d45-49e6-8094-0c74c749fd25'
example: 'https://res.cloudinary.com/drta9lo35/image/upload/v1715929846/knmgqbnkllurf88xxd3b.glb'
})
modelId?: string
modelUrl?: string

@ApiProperty()
rate: number
Expand Down
6 changes: 2 additions & 4 deletions src/product/schemas/product.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class Product {

@ApiProperty()
@Prop({ type: String, required: false })
modelId?: string
modelUrl?: string

@ApiProperty()
@Prop({ type: Number, default: 0 })
Expand Down Expand Up @@ -145,8 +145,6 @@ ProductSchema.index(
}
}
)
ProductSchema.index(
{ 'name': 'text' },
)
ProductSchema.index({ name: 'text' })
ProductSchema.plugin(paginate)
ProductSchema.plugin(slug)
2 changes: 1 addition & 1 deletion src/product/services/product.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ProductService {
name: 1,
rate: 1,
images: 1,
modelId: 1,
modelUrl: 1,
variants: 1,
categories: 1,
slug: 1
Expand Down

0 comments on commit 2305875

Please sign in to comment.