refactor(db/models): change _id field in inbox schema to a reference field that points to the owning user

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2023-10-02 16:06:01 -04:00
parent 38516dc80d
commit a16e58b2b4
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

@ -8,16 +8,18 @@ import mongoose, {
import SequenceFactory from "mongoose-sequence";
import { IPrivMsg } from "./privMsg";
import { IUser } from "./user";
export interface IInbox {
_id: number;
owningUser: PopulatedDoc<IUser & Document>;
saved: PopulatedDoc<IPrivMsg & Document>[];
received: PopulatedDoc<IPrivMsg & Document>[];
sent: PopulatedDoc<IPrivMsg & Document>[];
}
const InboxSchema = new Schema<IInbox>({
_id: {
owningUser: {
type: Number,
ref: "User",
},
saved: [
{