I have a user schema with typescript, bellow is my interface
interface IUser{
name: string;
email: string;
password: string;
isAdmin: boolean;
}
And below is the user schema
const UserSchema = new Schema<IUser>(
{
name: {
type: String,
required: true,
},
email: {
type: String,
required: true,
unique: true,
validate: [validator.isEmail, "Please provide a valid email"],
},
password: {
type: String,
required: true,
minlength: 8,
},
isAdmin: {
type: Boolean,
required: true,
default: false,
},
},
{
timestamps: true,
}
);
const UserModel = model("User", UserSchema);
module.exports = UserModel;
i get the typescript error: Untyped function calls may not accept type arguments on the user schema, in express and mongoose with editor visual studio.