21 lines
436 B
JavaScript
21 lines
436 B
JavaScript
import mongoose from "mongoose";
|
|
|
|
const LogSchema = mongoose.Schema(
|
|
{
|
|
userId: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: "User",
|
|
required: true,
|
|
},
|
|
method: { type: String, required: true },
|
|
body: [],
|
|
endpoint: { type: String, required: true },
|
|
timestamp: { type: Date, default: Date.now },
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
const Log = mongoose.model("Log", LogSchema);
|
|
|
|
export default Log;
|