shironegi39 1 год назад
Родитель
Сommit
b78c6f46ad

+ 1 - 2
apps/app/src/interfaces/in-app-notification.ts

@@ -1,9 +1,8 @@
 import type { IUser } from '@growi/core';
 import type { IUser } from '@growi/core';
 
 
-import { SupportedTargetModelType, SupportedActionType } from './activity';
+import type { SupportedTargetModelType, SupportedActionType } from './activity';
 
 
 export enum InAppNotificationStatuses {
 export enum InAppNotificationStatuses {
-  STATUS_UNREAD = 'UNREAD',
   STATUS_UNOPENED = 'UNOPENED',
   STATUS_UNOPENED = 'UNOPENED',
   STATUS_OPENED = 'OPENED',
   STATUS_OPENED = 'OPENED',
 }
 }

+ 1 - 5
apps/app/src/server/models/in-app-notification.ts

@@ -10,7 +10,7 @@ import { getOrCreateModel } from '../util/mongoose-utils';
 import type { ActivityDocument } from './activity';
 import type { ActivityDocument } from './activity';
 
 
 
 
-const { STATUS_UNREAD, STATUS_UNOPENED, STATUS_OPENED } = InAppNotificationStatuses;
+const { STATUS_UNOPENED, STATUS_OPENED } = InAppNotificationStatuses;
 
 
 export interface InAppNotificationDocument extends Document {
 export interface InAppNotificationDocument extends Document {
   _id: Types.ObjectId
   _id: Types.ObjectId
@@ -31,7 +31,6 @@ export interface InAppNotificationModel extends Model<InAppNotificationDocument>
   open(user, id: Types.ObjectId): Promise<InAppNotificationDocument | null>
   open(user, id: Types.ObjectId): Promise<InAppNotificationDocument | null>
   read(user) /* : Promise<Query<any>> */
   read(user) /* : Promise<Query<any>> */
 
 
-  STATUS_UNREAD: string
   STATUS_UNOPENED: string
   STATUS_UNOPENED: string
   STATUS_OPENED: string
   STATUS_OPENED: string
 }
 }
@@ -95,9 +94,6 @@ inAppNotificationSchema.index({
 inAppNotificationSchema.statics.STATUS_UNOPENED = function() {
 inAppNotificationSchema.statics.STATUS_UNOPENED = function() {
   return STATUS_UNOPENED;
   return STATUS_UNOPENED;
 };
 };
-inAppNotificationSchema.statics.STATUS_UNREAD = function() {
-  return STATUS_UNREAD;
-};
 inAppNotificationSchema.statics.STATUS_OPENED = function() {
 inAppNotificationSchema.statics.STATUS_OPENED = function() {
   return STATUS_OPENED;
   return STATUS_OPENED;
 };
 };

+ 1 - 9
apps/app/src/server/service/in-app-notification.ts

@@ -25,7 +25,7 @@ import { preNotifyService, type PreNotify } from './pre-notify';
 import { RoomPrefix, getRoomNameWithId } from './socket-io/helper';
 import { RoomPrefix, getRoomNameWithId } from './socket-io/helper';
 
 
 
 
-const { STATUS_UNREAD, STATUS_UNOPENED, STATUS_OPENED } = InAppNotificationStatuses;
+const { STATUS_UNOPENED, STATUS_OPENED } = InAppNotificationStatuses;
 
 
 const logger = loggerFactory('growi:service:inAppNotification');
 const logger = loggerFactory('growi:service:inAppNotification');
 
 
@@ -147,14 +147,6 @@ export default class InAppNotificationService {
     }
     }
   };
   };
 
 
-  read = async function(user: Types.ObjectId): Promise<void> {
-    const query = { user, status: STATUS_UNREAD };
-    const parameters = { status: STATUS_UNOPENED };
-    await InAppNotification.updateMany(query, parameters);
-
-    return;
-  };
-
   open = async function(user: IUser & HasObjectId, id: Types.ObjectId): Promise<void> {
   open = async function(user: IUser & HasObjectId, id: Types.ObjectId): Promise<void> {
     const query = { _id: id, user: user._id };
     const query = { _id: id, user: user._id };
     const parameters = { status: STATUS_OPENED };
     const parameters = { status: STATUS_OPENED };