From e23faf84d421a3578b84b9c827dd3581d1567f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 3 Oct 2023 01:14:20 -0400 Subject: [PATCH] refactor(db/models): remove `reviews` field from chapter type kinda redundant since there's also `IStory.reviews` :/ --- models/stories/chapter.ts | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/models/stories/chapter.ts b/models/stories/chapter.ts index a970459..71334b5 100644 --- a/models/stories/chapter.ts +++ b/models/stories/chapter.ts @@ -1,5 +1,5 @@ -import mongoose, {Schema, PopulatedDoc, Document, Model} from "mongoose"; -import { IBand } from "../band"; +import mongoose, { Schema, PopulatedDoc, Document, Model } from "mongoose"; +import { IBand } from "~/models/band"; export interface IChapter { title: string; summary: string; @@ -14,52 +14,52 @@ export interface IChapter { nsfw: boolean; loggedInOnly: boolean; hidden: boolean; - posted: Date; - reviews: number + posted?: Date; } export const Chapter = new mongoose.Schema({ title: { type: String, - default: "" + default: "", }, id: { - type: Number + type: Number, }, summary: { - type: String + type: String, }, words: { - type: Number + type: Number, }, notes: { - type: String - }, - genre: [{ - type: String - }], - bands: [{ - type: Number, - ref: "Band" - }], - reviews: { - type: Number + type: String, }, + genre: [ + { + type: String, + }, + ], + bands: [ + { + type: Number, + ref: "Band", + }, + ], characters: [{ type: String }], - relationships: [{ type: String }], + relationships: [[{ type: String }]], nsfw: { - type: Boolean + type: Boolean, }, loggedInOnly: { type: Boolean, - default: true + default: true, }, hidden: { type: Boolean, - default: false + default: false, }, posted: { type: Date, - default: new Date() - } -}) + default: new Date(), + }, +});