Notifications (#1)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ObjectId, Schema, model } from "mongoose"
|
||||
import { Schema, model } from "mongoose"
|
||||
|
||||
export interface GradeNote {
|
||||
label: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ObjectId, Schema, model } from "mongoose"
|
||||
import { Schema, Types, model } from "mongoose"
|
||||
|
||||
interface IKey {
|
||||
room: string;
|
||||
whom: ObjectId;
|
||||
whom: Types.ObjectId;
|
||||
borrow: Date;
|
||||
tb?: Date;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mongoose, { Schema } from "mongoose"
|
||||
import mongoose, { Types, Schema } from "mongoose"
|
||||
|
||||
interface INotification {
|
||||
endpoint: string;
|
||||
@@ -6,7 +6,7 @@ interface INotification {
|
||||
auth: string;
|
||||
p256dh: string;
|
||||
};
|
||||
uname: string
|
||||
user: Types.ObjectId
|
||||
expirationTime?: number
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ const notifSchema = new Schema<INotification>({
|
||||
auth: String,
|
||||
p256dh: String,
|
||||
},
|
||||
uname: {type: String, required: true},
|
||||
user: {type: Schema.ObjectId, required: true, ref: "logins"},
|
||||
expirationTime: Number
|
||||
})
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import mongoose, { ObjectId, Schema } from "mongoose"
|
||||
import mongoose, { Types, Schema } from "mongoose"
|
||||
|
||||
// TODO: Unify `fname` and `surename` into single field
|
||||
|
||||
interface IUser {
|
||||
export interface IUser {
|
||||
uname: string;
|
||||
pass: string;
|
||||
room?: string;
|
||||
@@ -10,7 +10,7 @@ interface IUser {
|
||||
locked?: boolean;
|
||||
fname?: string;
|
||||
surname?: string;
|
||||
groups: ObjectId[];
|
||||
groups: Types.ObjectId[];
|
||||
}
|
||||
|
||||
const userSchema = new Schema<IUser>({
|
||||
|
||||
Reference in New Issue
Block a user