30 lines
543 B
JavaScript
30 lines
543 B
JavaScript
|
|
|
||
|
|
import mongoose from 'mongoose';
|
||
|
|
import User from './userModel';
|
||
|
|
|
||
|
|
const postSchema = new mongoose.Schema({
|
||
|
|
user: {
|
||
|
|
type: User,
|
||
|
|
required: true
|
||
|
|
},
|
||
|
|
date: {
|
||
|
|
type: Date,
|
||
|
|
required: true
|
||
|
|
},
|
||
|
|
photo: {
|
||
|
|
type: String,
|
||
|
|
required: true
|
||
|
|
},
|
||
|
|
notes: {
|
||
|
|
type: String,
|
||
|
|
},
|
||
|
|
status: {
|
||
|
|
type: String,
|
||
|
|
enum: ['created', 'pending', 'denied', 'approved'],
|
||
|
|
default: 'created'
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
const Post = mongoose.model('User', postSchema);
|
||
|
|
|
||
|
|
export default Post;
|