mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
refactor models to typescript
This commit is contained in:
1 parent
253bd04588
commit
ee03b9999e
16 files changed
+3
-1
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
import stageSchema from './stage.js'
|
||||
import globalExceptionSchema from './globalException.js'
|
||||
|
||||
const Quest = model(
|
||||
'Quest',
|
||||
new Schema({
|
||||
_id: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
image: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
requirements: {
|
||||
type: [
|
||||
{
|
||||
type: String,
|
||||
ref: 'Quest',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
},
|
||||
instruction: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
stages: {
|
||||
type: [stageSchema],
|
||||
required: true,
|
||||
},
|
||||
exceptions: {
|
||||
type: [globalExceptionSchema],
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
)
|
||||
|
||||
export default Quest
|
||||
Reference in new issue
Block a user