fix: News now display author
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import mongoose, { Schema } from "mongoose"
|
||||
import mongoose, { Schema, Types } from "mongoose"
|
||||
|
||||
interface INews {
|
||||
content: string;
|
||||
title: string;
|
||||
date: Date;
|
||||
visible?: boolean;
|
||||
pinned?: boolean
|
||||
pinned?: boolean;
|
||||
author: Types.ObjectId
|
||||
}
|
||||
|
||||
const newsSchema = new Schema<INews>({
|
||||
@@ -13,7 +14,8 @@ const newsSchema = new Schema<INews>({
|
||||
title: {type: String, required: true},
|
||||
date: {type: Date, requred: true, default: Date.now},
|
||||
visible: {type: Boolean, default: false},
|
||||
pinned: {type: Boolean, default: false}
|
||||
pinned: {type: Boolean, default: false},
|
||||
author: {type: "ObjectId", ref: "logins", required: true}
|
||||
})
|
||||
|
||||
export default mongoose.model("news", newsSchema)
|
||||
Reference in New Issue
Block a user