product verity

This commit is contained in:
morteza-mortezai
2025-11-29 10:14:48 +03:30
parent a9283d352e
commit 9f32dff2c0
4 changed files with 8 additions and 7 deletions
@@ -244,6 +244,7 @@ export class AdminCategoryController extends BaseController {
@ApiOperation("Update a theme value ==> need to login as admin")
@ApiResponse("theme value updated successfully", HttpStatus.Ok)
@ApiAuth()
@ApiModel(UpdateThemeValueDTO)
@httpPut(
"/theme-value",
Guard.authAdmin(),
@@ -1,5 +1,5 @@
import { Expose } from "class-transformer";
import { IsNotEmpty, IsString } from "class-validator";
import { IsNotEmpty, IsOptional, IsString } from "class-validator";
import { ApiProperty } from "../../../common/decorator/swggerDocs";
import { IsValidId } from "../../../common/decorator/validation.decorator";
@@ -14,10 +14,10 @@ export class CreateThemeValueDTO {
theme: string;
@Expose()
@IsNotEmpty()
@IsOptional()
@IsString()
@ApiProperty({ type: "string", description: "the name of theme value", example: "Red" })
name: string;
@ApiProperty({ type: "string", description: "the name of theme value", example: "Red", required: false })
name?: string;
@Expose()
@IsNotEmpty()
@@ -3,6 +3,6 @@ import { Types } from "mongoose";
export interface IThemeValue {
_id: Types.ObjectId;
theme: Types.ObjectId;
name: string;
value: string;
name?: string;
value: string | number;
}
@@ -5,7 +5,7 @@ import { IThemeValue } from "./Abstraction/IThemeValue";
const themeValueSchema = new Schema<IThemeValue>(
{
theme: { type: Schema.Types.ObjectId, ref: "Theme", required: true },
name: { type: String, required: true },
name: { type: String, required: false },
value: { type: Schema.Types.Mixed, required: true },
},
{ timestamps: true, toJSON: { virtuals: true, versionKey: false }, id: false },