Added: tests, signin api, not working docker
This commit is contained in:
26
api/src/models/User.ts
Normal file
26
api/src/models/User.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import path from 'path';
|
||||
import { Schema, model } from 'mongoose';
|
||||
import { IUser } from '../validators/authValidator';
|
||||
|
||||
const schema = new Schema<IUser>(
|
||||
{
|
||||
username: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
{
|
||||
timestamps: true
|
||||
}
|
||||
);
|
||||
|
||||
export default model(path.basename(__filename).split('.')[0], schema);
|
Reference in New Issue
Block a user