First commit
This commit is contained in:
21
backend/src/models/Item.js
Normal file
21
backend/src/models/Item.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const itemSchema = new mongoose.Schema(
|
||||
{
|
||||
name: {
|
||||
type: String,
|
||||
required: [true, "Name is required"],
|
||||
trim: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: "",
|
||||
trim: true,
|
||||
},
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const Item = mongoose.model("Item", itemSchema);
|
||||
|
||||
export default Item;
|
||||
Reference in New Issue
Block a user