Latest Project, Trash and setting API and sockets along with the Model clearance
This commit is contained in:
@@ -1,24 +1,20 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import { Schema, Document } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
export interface product extends Document {
|
||||
export interface Product extends Document {
|
||||
productName: string;
|
||||
productId: string;
|
||||
eventsData: [];
|
||||
isArchive: boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Product Schema
|
||||
const ProductSchema = new Schema({
|
||||
productName: { type: String, required: true },
|
||||
productId: { type: String, required: true },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
|
||||
const ProductModel = (db: string) => {
|
||||
return MainModel(db, "Product", ProductSchema, "Product");
|
||||
};
|
||||
|
||||
export default ProductModel;
|
||||
export default ProductModel;
|
||||
|
||||
Reference in New Issue
Block a user