mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
add types to models
This commit is contained in:
1 parent
5489de2432
commit
9dc0b43737
16 files changed
+179
-73
No files matched your search
@@ -1,6 +1,13 @@
|
||||
import { Schema } from 'mongoose'
|
||||
|
||||
const responseSchema = new Schema({
|
||||
export interface IResponse {
|
||||
type: 'narrative' | 'dialogue'
|
||||
content: string[]
|
||||
speaker?: string
|
||||
color?: string
|
||||
}
|
||||
|
||||
export const responseSchema = new Schema<IResponse>({
|
||||
type: {
|
||||
type: String,
|
||||
enum: ['narrative', 'dialogue'],
|
||||
@@ -14,5 +21,3 @@ const responseSchema = new Schema({
|
||||
speaker: { type: String, default: 'Ada' },
|
||||
color: String,
|
||||
})
|
||||
|
||||
export default responseSchema
|
||||
Reference in new issue
Block a user