Commit 77723476 authored by nanahira's avatar nanahira

add validate condition

parent bc7cf0af
Pipeline #11757 passed with stages
in 2 minutes and 40 seconds
import { Column, Entity, Index, SelectQueryBuilder } from 'typeorm';
import { IdBase } from './bases/IdBase.entity';
import { StringColumn } from './decorators/base';
import { IsDate } from 'class-validator';
import { IsDate, ValidateIf } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Session } from 'koishi';
import { applyQueryProperty, applyQueryPropertySearch } from './utility/query';
......@@ -23,6 +23,7 @@ export class RankRecord extends IdBase {
rankDate: Date;
@Index()
@ValidateIf((v) => v?.length)
@StringColumn(6, 'Rank content', undefined, true)
rankName: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment