Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
83e41a01
Commit
83e41a01
authored
Jul 08, 2022
by
Yoon, Daeki
😅
Browse files
역할 모델 스키마 변경 toJSON 추가
parent
ad70cd38
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/models/index.ts
View file @
83e41a01
export
{
default
as
User
,
IUser
}
from
"
./user.model
"
;
export
{
default
as
Role
}
from
"
./role.model
"
;
src/models/role.model.ts
View file @
83e41a01
...
...
@@ -5,9 +5,12 @@ interface IRole {
priority
:
number
;
}
const
schema
=
new
Schema
<
IRole
>
({
name
:
{
type
:
String
},
priority
:
{
type
:
Number
},
});
const
schema
=
new
Schema
<
IRole
>
(
{
name
:
{
type
:
String
,
unique
:
true
},
priority
:
{
type
:
Number
},
},
{
toJSON
:
{
versionKey
:
false
}
}
);
export
default
model
<
IRole
>
(
"
Role
"
,
schema
);
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