revert(db/models): re-add & Document
to PopulatedDoc type parameters
This commit is contained in:
parent
8f45dbe563
commit
8cdfb6abfe
@ -16,7 +16,7 @@ export interface IBiffno {
|
|||||||
genre: string;
|
genre: string;
|
||||||
cover: string;
|
cover: string;
|
||||||
year: number;
|
year: number;
|
||||||
author: PopulatedDoc<IUser>;
|
author: PopulatedDoc<IUser & Document>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const biffnoschema = new mongoose.Schema<IBiffno>({
|
const biffnoschema = new mongoose.Schema<IBiffno>({
|
||||||
|
@ -11,9 +11,9 @@ export interface IFicmas {
|
|||||||
_id: number;
|
_id: number;
|
||||||
kink: string;
|
kink: string;
|
||||||
year: number;
|
year: number;
|
||||||
bands: PopulatedDoc<IBand>[];
|
bands: PopulatedDoc<IBand & Document>[];
|
||||||
relationship: string;
|
relationship: string;
|
||||||
wisher: PopulatedDoc<IUser>;
|
wisher: PopulatedDoc<IUser & Document>;
|
||||||
anniversary: boolean;
|
anniversary: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@ import mongoose, { Schema, PopulatedDoc, Model } from "mongoose";
|
|||||||
import { IPrivMsg } from "./privMsg";
|
import { IPrivMsg } from "./privMsg";
|
||||||
import { IUser } from "./user";
|
import { IUser } from "./user";
|
||||||
export interface IInbox {
|
export interface IInbox {
|
||||||
owningUser: PopulatedDoc<IUser>;
|
owningUser: PopulatedDoc<IUser & Document>;
|
||||||
saved: PopulatedDoc<IPrivMsg>[];
|
saved: PopulatedDoc<IPrivMsg & Document>[];
|
||||||
received: PopulatedDoc<IPrivMsg>[];
|
received: PopulatedDoc<IPrivMsg & Document>[];
|
||||||
sent: PopulatedDoc<IPrivMsg>[];
|
sent: PopulatedDoc<IPrivMsg & Document>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const InboxSchema = new Schema<IInbox>({
|
const InboxSchema = new Schema<IInbox>({
|
||||||
|
@ -7,8 +7,8 @@ const AutoIncrement = SequenceFactory(mongoose);
|
|||||||
|
|
||||||
export interface IPrivMsg {
|
export interface IPrivMsg {
|
||||||
_id: number;
|
_id: number;
|
||||||
from: PopulatedDoc<IUser>;
|
from: PopulatedDoc<IUser & Document>;
|
||||||
to: PopulatedDoc<IUser>;
|
to: PopulatedDoc<IUser & Document>;
|
||||||
subject: string;
|
subject: string;
|
||||||
content: string;
|
content: string;
|
||||||
sentAt: Date;
|
sentAt: Date;
|
||||||
|
@ -8,7 +8,7 @@ export interface IChapter {
|
|||||||
words?: number;
|
words?: number;
|
||||||
notes: string;
|
notes: string;
|
||||||
genre: string[];
|
genre: string[];
|
||||||
bands: PopulatedDoc<IBand>[];
|
bands: PopulatedDoc<IBand & Document>[];
|
||||||
characters: string[];
|
characters: string[];
|
||||||
relationships: string[][];
|
relationships: string[][];
|
||||||
nsfw: boolean;
|
nsfw: boolean;
|
||||||
|
@ -12,19 +12,19 @@ import { hasMigrated } from "@dbconfig";
|
|||||||
export interface IStory {
|
export interface IStory {
|
||||||
_id?: number;
|
_id?: number;
|
||||||
title: string;
|
title: string;
|
||||||
author: PopulatedDoc<IUser>;
|
author: PopulatedDoc<IUser & Document>;
|
||||||
chapters: IChapter[];
|
chapters: IChapter[];
|
||||||
recs: number;
|
recs: number;
|
||||||
favs: number;
|
favs: number;
|
||||||
reviews: number;
|
reviews: number;
|
||||||
views: number;
|
views: number;
|
||||||
completed: boolean;
|
completed: boolean;
|
||||||
challenge: PopulatedDoc<IChallenge> | null;
|
challenge: PopulatedDoc<IChallenge & Document> | null;
|
||||||
ficmas: PopulatedDoc<IFicmas> | null;
|
ficmas: PopulatedDoc<IFicmas & Document> | null;
|
||||||
downloads: number;
|
downloads: number;
|
||||||
lastUpdate: Date;
|
lastUpdate: Date;
|
||||||
posted: Date;
|
posted: Date;
|
||||||
coAuthor: PopulatedDoc<IUser> | null;
|
coAuthor: PopulatedDoc<IUser & Document> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StorySchema = new mongoose.Schema<IStory>({
|
const StorySchema = new mongoose.Schema<IStory>({
|
||||||
|
@ -11,10 +11,10 @@ export interface IReview {
|
|||||||
text: string;
|
text: string;
|
||||||
leftOn: number;
|
leftOn: number;
|
||||||
whichChapter: number;
|
whichChapter: number;
|
||||||
author: PopulatedDoc<IUser>;
|
author: PopulatedDoc<IUser & Document>;
|
||||||
datePosted: Date;
|
datePosted: Date;
|
||||||
replyingTo: PopulatedDoc<IReview> | null;
|
replyingTo: PopulatedDoc<IReview & Document> | null;
|
||||||
replies: PopulatedDoc<IReview>[];
|
replies: PopulatedDoc<IReview & Document>[];
|
||||||
}
|
}
|
||||||
const CommentSchema = new mongoose.Schema<IReview>({
|
const CommentSchema = new mongoose.Schema<IReview>({
|
||||||
_id: {
|
_id: {
|
||||||
|
@ -7,6 +7,7 @@ import { hasMigrated } from "@dbconfig";
|
|||||||
import { IBand } from "./band";
|
import { IBand } from "./band";
|
||||||
import { IStory } from "./stories/index";
|
import { IStory } from "./stories/index";
|
||||||
import { QuickMenuItem, QuickMenuSchema } from "./quickMenu";
|
import { QuickMenuItem, QuickMenuSchema } from "./quickMenu";
|
||||||
|
import { FilterPick, PopulatedDocKeys, PopulatedPick } from "~/utils/filter";
|
||||||
|
|
||||||
const AutoIncrement = SequenceFactory(mongoose);
|
const AutoIncrement = SequenceFactory(mongoose);
|
||||||
interface IIPLogEntry {
|
interface IIPLogEntry {
|
||||||
@ -51,19 +52,19 @@ export interface IUser extends Document {
|
|||||||
wins: number;
|
wins: number;
|
||||||
};
|
};
|
||||||
favs: {
|
favs: {
|
||||||
authors: PopulatedDoc<IUser>[];
|
authors: PopulatedDoc<IUser & Document>[];
|
||||||
stories: PopulatedDoc<IStory>[];
|
stories: PopulatedDoc<IStory & Document>[];
|
||||||
};
|
};
|
||||||
subscriptions: {
|
subscriptions: {
|
||||||
authors: PopulatedDoc<IUser>[];
|
authors: PopulatedDoc<IUser & Document>[];
|
||||||
bands: PopulatedDoc<IBand>[];
|
bands: PopulatedDoc<IBand & Document>[];
|
||||||
stories: PopulatedDoc<IStory>[];
|
stories: PopulatedDoc<IStory & Document>[];
|
||||||
};
|
};
|
||||||
//@ts-ignore SHUT UP
|
//@ts-ignore SHUT UP
|
||||||
hiddenAuthors: PopulatedDoc<IUser>[];
|
hiddenAuthors: PopulatedDoc<IUser & Document>[];
|
||||||
hiddenBands: PopulatedDoc<IBand>[];
|
hiddenBands: PopulatedDoc<IBand & Document>[];
|
||||||
//@ts-ignore SHUT UP
|
//@ts-ignore SHUT UP
|
||||||
blocked: PopulatedDoc<IUser>[];
|
blocked: PopulatedDoc<IUser & Document>[];
|
||||||
sessionId: string | null;
|
sessionId: string | null;
|
||||||
banned: boolean;
|
banned: boolean;
|
||||||
quickMenuConfig: QuickMenuItem[];
|
quickMenuConfig: QuickMenuItem[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user