mostly adding posts controller and model but also updating some users stuff

This commit is contained in:
Will Baumbach
2025-07-25 16:33:34 -05:00
parent 11afa68c09
commit 2704577d39
5 changed files with 153 additions and 3 deletions

30
api/models/postModel.js Normal file
View File

@@ -0,0 +1,30 @@
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;