POS_node/models/Endpoint.js

68 lines
1.1 KiB
JavaScript

import mongoose from "mongoose";
const EndpointSchema = mongoose.Schema(
{
endpoint: {
type: String,
// required: true,
},
name: {
type: String,
// required: true,
},
method: {
type: String,
// required: true,
},
collection_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "Collection",
},
// created_by: {
// type: mongoose.Schema.Types.ObjectId,
// ref: "User",
// },
body_json: {
type: Array,
},
form_data: [
{
key: {
type: String,
},
value: {
type: String,
},
//required: true,
},
],
header: [
{
key: {
type: String,
},
value: {
type: String,
},
//required: true,
},
],
params: [
{
key: {
type: String,
},
value: {
type: String,
},
//required: true,
},
],
},
{ timestamps: true }
);
const Endpoint = mongoose.model("Endpoint", EndpointSchema);
export default Endpoint;