Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init-things
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
init-things
Commits
3e916a17
Commit
3e916a17
authored
Nov 30, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8c07399c
Pipeline
#7281
passed with stages
in 1 minute and 59 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
things/nest-typeorm/src/entities/bases/TimeBase.entity.ts
things/nest-typeorm/src/entities/bases/TimeBase.entity.ts
+4
-6
things/nest-typeorm/src/entities/decorators/base.ts
things/nest-typeorm/src/entities/decorators/base.ts
+4
-0
No files found.
things/nest-typeorm/src/entities/bases/TimeBase.entity.ts
View file @
3e916a17
...
...
@@ -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
()
{
...
...
things/nest-typeorm/src/entities/decorators/base.ts
View file @
3e916a17
...
...
@@ -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
})]);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment