mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +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,8 +1,19 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
import { model, Schema, Types } from 'mongoose'
|
||||
|
||||
const Command = model(
|
||||
export interface ICommand {
|
||||
session: Types.ObjectId
|
||||
pwd: string
|
||||
command: string
|
||||
output?: string
|
||||
error?: string
|
||||
stage?: string
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
export const Command = model<ICommand>(
|
||||
'Command',
|
||||
new Schema(
|
||||
new Schema<ICommand>(
|
||||
{
|
||||
session: {
|
||||
type: Schema.ObjectId,
|
||||
@@ -33,5 +44,3 @@ const Command = model(
|
||||
{ timestamps: true }
|
||||
)
|
||||
)
|
||||
|
||||
export default Command
|
||||
Reference in new issue
Block a user