Procházet zdrojové kódy

fix migration value

shironegi39 před 1 rokem
rodič
revize
a3d2c97137

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

@@ -3,7 +3,6 @@ import type { IUser } from '@growi/core';
 import type { 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',
 }
 }

+ 2 - 3
apps/app/src/migrations/20240924181317-changed-status-in-inappnotifications-from-unread-to-unopened.js

@@ -1,4 +1,3 @@
-import { InAppNotificationStatuses } from '~/interfaces/in-app-notification';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
 const logger = loggerFactory('growi:changed-status-in-inappnotifications-from-unread-to-unopened');
 const logger = loggerFactory('growi:changed-status-in-inappnotifications-from-unread-to-unopened');
@@ -9,11 +8,11 @@ module.exports = {
 
 
     const unreadInAppnotifications = await db.collection('inappnotifications');
     const unreadInAppnotifications = await db.collection('inappnotifications');
     await unreadInAppnotifications.updateMany(
     await unreadInAppnotifications.updateMany(
-      { status: { $eq: InAppNotificationStatuses.STATUS_UNREAD } },
+      { status: { $eq: 'UNREAD' } },
       [
       [
         {
         {
           $set: {
           $set: {
-            status: InAppNotificationStatuses.STATUS_UNOPENED,
+            status: 'UNOPENED',
           },
           },
         },
         },
       ],
       ],