Commit 3e916a17 authored by nanahira's avatar nanahira

fix

parent 8c07399c
Pipeline #7281 passed with stages
in 1 minute and 59 seconds
......@@ -2,6 +2,7 @@ import { CreateDateColumn, DeleteDateColumn, UpdateDateColumn } from 'typeorm';
import { Exclude } from 'class-transformer';
import { PageSettingsDto } from '../../dto/PageSettings.dto';
import { ApiProperty } from '@nestjs/swagger';
import { NotColumn } from '../decorators/base';
export interface DeletionWise {
deleteTime?: Date;
......@@ -9,18 +10,15 @@ export interface DeletionWise {
export class TimeBase extends PageSettingsDto implements DeletionWise {
@CreateDateColumn({ select: false })
@ApiProperty({ required: false })
@Exclude()
@NotColumn()
createTime: Date;
@UpdateDateColumn({ select: false })
@ApiProperty({ required: false })
@Exclude()
@NotColumn()
updateTime: Date;
@DeleteDateColumn({ select: false })
@ApiProperty({ required: false })
@Exclude()
@NotColumn()
deleteTime: Date;
toObject() {
......
......@@ -13,6 +13,7 @@ import {
} from 'class-validator';
import { ColumnWithWidthOptions } from 'typeorm/decorator/options/ColumnWithWidthOptions';
import { BigintTransformer } from '../utility/bigint-transform';
import { Exclude } from 'class-transformer';
export function MergePropertyDecorators(
decs: PropertyDecorator[],
......@@ -109,3 +110,6 @@ export const EnumColumn = <T>(
...(required ? [] : [IsOptional()]),
IsEnum(targetEnum),
]);
export const NotColumn = (): PropertyDecorator =>
MergePropertyDecorators([Exclude(), ApiProperty({ required: false })]);
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