revert(db/models): re-add & Document to PopulatedDoc type parameters

This commit is contained in:
parent 8f45dbe563
commit 8cdfb6abfe
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C
8 changed files with 26 additions and 25 deletions

@ -16,7 +16,7 @@ export interface IBiffno {
genre: string;
cover: string;
year: number;
author: PopulatedDoc<IUser>;
author: PopulatedDoc<IUser & Document>;
}
const biffnoschema = new mongoose.Schema<IBiffno>({

@ -11,9 +11,9 @@ export interface IFicmas {
_id: number;
kink: string;
year: number;
bands: PopulatedDoc<IBand>[];
bands: PopulatedDoc<IBand & Document>[];
relationship: string;
wisher: PopulatedDoc<IUser>;
wisher: PopulatedDoc<IUser & Document>;
anniversary: boolean;
}

@ -3,10 +3,10 @@ import mongoose, { Schema, PopulatedDoc, Model } from "mongoose";
import { IPrivMsg } from "./privMsg";
import { IUser } from "./user";
export interface IInbox {
owningUser: PopulatedDoc<IUser>;
saved: PopulatedDoc<IPrivMsg>[];
received: PopulatedDoc<IPrivMsg>[];
sent: PopulatedDoc<IPrivMsg>[];
owningUser: PopulatedDoc<IUser & Document>;
saved: PopulatedDoc<IPrivMsg & Document>[];
received: PopulatedDoc<IPrivMsg & Document>[];
sent: PopulatedDoc<IPrivMsg & Document>[];
}
const InboxSchema = new Schema<IInbox>({

@ -7,8 +7,8 @@ const AutoIncrement = SequenceFactory(mongoose);
export interface IPrivMsg {
_id: number;
from: PopulatedDoc<IUser>;
to: PopulatedDoc<IUser>;
from: PopulatedDoc<IUser & Document>;
to: PopulatedDoc<IUser & Document>;
subject: string;
content: string;
sentAt: Date;

@ -8,7 +8,7 @@ export interface IChapter {
words?: number;
notes: string;
genre: string[];
bands: PopulatedDoc<IBand>[];
bands: PopulatedDoc<IBand & Document>[];
characters: string[];
relationships: string[][];
nsfw: boolean;

@ -12,19 +12,19 @@ import { hasMigrated } from "@dbconfig";
export interface IStory {
_id?: number;
title: string;
author: PopulatedDoc<IUser>;
author: PopulatedDoc<IUser & Document>;
chapters: IChapter[];
recs: number;
favs: number;
reviews: number;
views: number;
completed: boolean;
challenge: PopulatedDoc<IChallenge> | null;
ficmas: PopulatedDoc<IFicmas> | null;
challenge: PopulatedDoc<IChallenge & Document> | null;
ficmas: PopulatedDoc<IFicmas & Document> | null;
downloads: number;
lastUpdate: Date;
posted: Date;
coAuthor: PopulatedDoc<IUser> | null;
coAuthor: PopulatedDoc<IUser & Document> | null;
}
const StorySchema = new mongoose.Schema<IStory>({

@ -11,10 +11,10 @@ export interface IReview {
text: string;
leftOn: number;
whichChapter: number;
author: PopulatedDoc<IUser>;
author: PopulatedDoc<IUser & Document>;
datePosted: Date;
replyingTo: PopulatedDoc<IReview> | null;
replies: PopulatedDoc<IReview>[];
replyingTo: PopulatedDoc<IReview & Document> | null;
replies: PopulatedDoc<IReview & Document>[];
}
const CommentSchema = new mongoose.Schema<IReview>({
_id: {

@ -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<IUser>[];
stories: PopulatedDoc<IStory>[];
authors: PopulatedDoc<IUser & Document>[];
stories: PopulatedDoc<IStory & Document>[];
};
subscriptions: {
authors: PopulatedDoc<IUser>[];
bands: PopulatedDoc<IBand>[];
stories: PopulatedDoc<IStory>[];
authors: PopulatedDoc<IUser & Document>[];
bands: PopulatedDoc<IBand & Document>[];
stories: PopulatedDoc<IStory & Document>[];
};
//@ts-ignore SHUT UP
hiddenAuthors: PopulatedDoc<IUser>[];
hiddenBands: PopulatedDoc<IBand>[];
hiddenAuthors: PopulatedDoc<IUser & Document>[];
hiddenBands: PopulatedDoc<IBand & Document>[];
//@ts-ignore SHUT UP
blocked: PopulatedDoc<IUser>[];
blocked: PopulatedDoc<IUser & Document>[];
sessionId: string | null;
banned: boolean;
quickMenuConfig: QuickMenuItem[];