team -> ts
This commit is contained in:
1 parent
9fa0113f2b
commit
36e02e0a9a
10 files changed
+110
-21
No files matched your search
Executable
+27
@@ -0,0 +1,27 @@
|
||||
import { Schema, model, type Types } from "mongoose";
|
||||
|
||||
import type { Team } from "@/types/index.js";
|
||||
|
||||
interface TeamDocument extends Team {
|
||||
_id: Types.ObjectId;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
const TeamSchema = new Schema<TeamDocument>(
|
||||
{
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
const TeamModel = model<TeamDocument>("Team", TeamSchema);
|
||||
|
||||
export type { TeamDocument };
|
||||
export { TeamModel };
|
||||
export default TeamModel;
|
||||
Reference in new issue
Block a user