|
@@ -8,7 +8,7 @@ const STATUS_WATCH = 'WATCH';
|
|
|
const STATUS_IGNORE = 'IGNORE';
|
|
const STATUS_IGNORE = 'IGNORE';
|
|
|
const STATUSES = [STATUS_WATCH, STATUS_IGNORE];
|
|
const STATUSES = [STATUS_WATCH, STATUS_IGNORE];
|
|
|
|
|
|
|
|
-export interface WatcherDocument extends Document {
|
|
|
|
|
|
|
+export interface IWatcher {
|
|
|
_id: Types.ObjectId
|
|
_id: Types.ObjectId
|
|
|
user: Types.ObjectId
|
|
user: Types.ObjectId
|
|
|
targetModel: string
|
|
targetModel: string
|
|
@@ -20,6 +20,8 @@ export interface WatcherDocument extends Document {
|
|
|
isIgnoring(): boolean
|
|
isIgnoring(): boolean
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+export interface WatcherDocument extends IWatcher, Document {}
|
|
|
|
|
+
|
|
|
export interface WatcherModel extends Model<WatcherDocument> {
|
|
export interface WatcherModel extends Model<WatcherDocument> {
|
|
|
findByUserIdAndTargetId(userId: Types.ObjectId, targetId: Types.ObjectId): any
|
|
findByUserIdAndTargetId(userId: Types.ObjectId, targetId: Types.ObjectId): any
|
|
|
upsertWatcher(user: Types.ObjectId, targetModel: string, target: Types.ObjectId, status: string): any
|
|
upsertWatcher(user: Types.ObjectId, targetModel: string, target: Types.ObjectId, status: string): any
|