From 8cdfb6abfeca00fb4e5275b7f724652a8ac93a0a 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: Sat, 30 Dec 2023 00:46:11 -0500 Subject: [PATCH] revert(db/models): re-add `& Document` to PopulatedDoc type parameters --- models/challenges/biffno.ts | 2 +- models/challenges/ficmas.ts | 4 ++-- models/inbox.ts | 8 ++++---- models/privMsg.ts | 4 ++-- models/stories/chapter.ts | 2 +- models/stories/index.ts | 8 ++++---- models/stories/review.ts | 6 +++--- models/user.ts | 17 +++++++++-------- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/models/challenges/biffno.ts b/models/challenges/biffno.ts index deb5c2b..741815f 100644 --- a/models/challenges/biffno.ts +++ b/models/challenges/biffno.ts @@ -16,7 +16,7 @@ export interface IBiffno { genre: string; cover: string; year: number; - author: PopulatedDoc; + author: PopulatedDoc; } const biffnoschema = new mongoose.Schema({ diff --git a/models/challenges/ficmas.ts b/models/challenges/ficmas.ts index f6d7be7..149988f 100644 --- a/models/challenges/ficmas.ts +++ b/models/challenges/ficmas.ts @@ -11,9 +11,9 @@ export interface IFicmas { _id: number; kink: string; year: number; - bands: PopulatedDoc[]; + bands: PopulatedDoc[]; relationship: string; - wisher: PopulatedDoc; + wisher: PopulatedDoc; anniversary: boolean; } diff --git a/models/inbox.ts b/models/inbox.ts index 6e0b6e8..488303a 100644 --- a/models/inbox.ts +++ b/models/inbox.ts @@ -3,10 +3,10 @@ import mongoose, { Schema, PopulatedDoc, Model } from "mongoose"; import { IPrivMsg } from "./privMsg"; import { IUser } from "./user"; export interface IInbox { - owningUser: PopulatedDoc; - saved: PopulatedDoc[]; - received: PopulatedDoc[]; - sent: PopulatedDoc[]; + owningUser: PopulatedDoc; + saved: PopulatedDoc[]; + received: PopulatedDoc[]; + sent: PopulatedDoc[]; } const InboxSchema = new Schema({ diff --git a/models/privMsg.ts b/models/privMsg.ts index 34af2eb..8e614bd 100644 --- a/models/privMsg.ts +++ b/models/privMsg.ts @@ -7,8 +7,8 @@ const AutoIncrement = SequenceFactory(mongoose); export interface IPrivMsg { _id: number; - from: PopulatedDoc; - to: PopulatedDoc; + from: PopulatedDoc; + to: PopulatedDoc; subject: string; content: string; sentAt: Date; diff --git a/models/stories/chapter.ts b/models/stories/chapter.ts index ac62397..b6b8f6c 100644 --- a/models/stories/chapter.ts +++ b/models/stories/chapter.ts @@ -8,7 +8,7 @@ export interface IChapter { words?: number; notes: string; genre: string[]; - bands: PopulatedDoc[]; + bands: PopulatedDoc[]; characters: string[]; relationships: string[][]; nsfw: boolean; diff --git a/models/stories/index.ts b/models/stories/index.ts index 4df86d5..6d4acd1 100644 --- a/models/stories/index.ts +++ b/models/stories/index.ts @@ -12,19 +12,19 @@ import { hasMigrated } from "@dbconfig"; export interface IStory { _id?: number; title: string; - author: PopulatedDoc; + author: PopulatedDoc; chapters: IChapter[]; recs: number; favs: number; reviews: number; views: number; completed: boolean; - challenge: PopulatedDoc | null; - ficmas: PopulatedDoc | null; + challenge: PopulatedDoc | null; + ficmas: PopulatedDoc | null; downloads: number; lastUpdate: Date; posted: Date; - coAuthor: PopulatedDoc | null; + coAuthor: PopulatedDoc | null; } const StorySchema = new mongoose.Schema({ diff --git a/models/stories/review.ts b/models/stories/review.ts index 85c5f94..f17bd38 100644 --- a/models/stories/review.ts +++ b/models/stories/review.ts @@ -11,10 +11,10 @@ export interface IReview { text: string; leftOn: number; whichChapter: number; - author: PopulatedDoc; + author: PopulatedDoc; datePosted: Date; - replyingTo: PopulatedDoc | null; - replies: PopulatedDoc[]; + replyingTo: PopulatedDoc | null; + replies: PopulatedDoc[]; } const CommentSchema = new mongoose.Schema({ _id: { diff --git a/models/user.ts b/models/user.ts index da6b0c7..863f081 100644 --- a/models/user.ts +++ b/models/user.ts @@ -7,6 +7,7 @@ import { hasMigrated } from "@dbconfig"; import { IBand } from "./band"; import { IStory } from "./stories/index"; import { QuickMenuItem, QuickMenuSchema } from "./quickMenu"; +import { FilterPick, PopulatedDocKeys, PopulatedPick } from "~/utils/filter"; const AutoIncrement = SequenceFactory(mongoose); interface IIPLogEntry { @@ -51,19 +52,19 @@ export interface IUser extends Document { wins: number; }; favs: { - authors: PopulatedDoc[]; - stories: PopulatedDoc[]; + authors: PopulatedDoc[]; + stories: PopulatedDoc[]; }; subscriptions: { - authors: PopulatedDoc[]; - bands: PopulatedDoc[]; - stories: PopulatedDoc[]; + authors: PopulatedDoc[]; + bands: PopulatedDoc[]; + stories: PopulatedDoc[]; }; //@ts-ignore SHUT UP - hiddenAuthors: PopulatedDoc[]; - hiddenBands: PopulatedDoc[]; + hiddenAuthors: PopulatedDoc[]; + hiddenBands: PopulatedDoc[]; //@ts-ignore SHUT UP - blocked: PopulatedDoc[]; + blocked: PopulatedDoc[]; sessionId: string | null; banned: boolean; quickMenuConfig: QuickMenuItem[];