Просмотр исходного кода

AllSupportedAction -> AllSupportedActions

Shun Miyazawa 3 лет назад
Родитель
Сommit
14811bc2a6

+ 2 - 2
packages/app/src/components/Admin/AuditLogManagement.tsx

@@ -4,7 +4,7 @@ import { format } from 'date-fns';
 import { useTranslation } from 'react-i18next';
 
 import {
-  SupportedActionType, AllSupportedAction, PageActions, CommentActions,
+  SupportedActionType, AllSupportedActions, PageActions, CommentActions,
 } from '~/interfaces/activity';
 import { useSWRxActivity } from '~/stores/activity';
 
@@ -39,7 +39,7 @@ export const AuditLogManagement: FC = () => {
   const [endDate, setEndDate] = useState<Date | null>(null);
   const [selectedUsernames, setSelectedUsernames] = useState<string[]>([]);
   const [actionMap, setActionMap] = useState(
-    new Map<SupportedActionType, boolean>(AllSupportedAction.map(action => [action, true])),
+    new Map<SupportedActionType, boolean>(AllSupportedActions.map(action => [action, true])),
   );
 
   /*

+ 1 - 1
packages/app/src/interfaces/activity.ts

@@ -210,7 +210,7 @@ export const CommentActions = Object.values({
  */
 export const AllSupportedTargetModels = Object.values(SupportedTargetModel);
 export const AllSupportedEventModels = Object.values(SupportedEventModel);
-export const AllSupportedAction = Object.values(SupportedAction);
+export const AllSupportedActions = Object.values(SupportedAction);
 export const AllSupportedActionToNotified = Object.values(SupportedActionToNotified);
 export const AllSmallGroupActions = Object.values(SmallActionGroup);
 export const AllMediumGroupActions = Object.values(MediumActionGroup);

+ 2 - 2
packages/app/src/server/models/activity.ts

@@ -5,7 +5,7 @@ import {
 import mongoosePaginate from 'mongoose-paginate-v2';
 
 import {
-  IActivity, ISnapshot, AllSupportedAction, SupportedActionType,
+  IActivity, ISnapshot, AllSupportedActions, SupportedActionType,
   AllSupportedTargetModels, SupportedTargetModelType,
   AllSupportedEventModels, SupportedEventModelType,
 } from '~/interfaces/activity';
@@ -71,7 +71,7 @@ const activitySchema = new Schema<ActivityDocument, ActivityModel>({
   },
   action: {
     type: String,
-    enum: AllSupportedAction,
+    enum: AllSupportedActions,
     required: true,
   },
   snapshot: snapshotSchema,

+ 2 - 2
packages/app/src/server/models/in-app-notification.ts

@@ -4,7 +4,7 @@ import {
 } from 'mongoose';
 import mongoosePaginate from 'mongoose-paginate-v2';
 
-import { AllSupportedTargetModels, AllSupportedAction } from '~/interfaces/activity';
+import { AllSupportedTargetModels, AllSupportedActions } from '~/interfaces/activity';
 import { InAppNotificationStatuses } from '~/interfaces/in-app-notification';
 
 import { ActivityDocument } from './activity';
@@ -56,7 +56,7 @@ const inAppNotificationSchema = new Schema<InAppNotificationDocument, InAppNotif
   action: {
     type: String,
     required: true,
-    enum: AllSupportedAction,
+    enum: AllSupportedActions,
   },
   activities: [
     {

+ 2 - 2
packages/app/src/server/service/activity.ts

@@ -1,7 +1,7 @@
 import mongoose from 'mongoose';
 
 import {
-  IActivity, SupportedActionType, ActionGroupSize, AllSupportedAction,
+  IActivity, SupportedActionType, ActionGroupSize, AllSupportedActions,
   AllSmallGroupActions, AllMediumGroupActions, AllLargeGroupActions, AllSupportedActionToNotified,
 } from '~/interfaces/activity';
 import { IPage } from '~/interfaces/page';
@@ -19,7 +19,7 @@ const parseActionString = (actionsString: string): SupportedActionType[] => {
   }
 
   const actions = actionsString.split(',').map(value => value.trim());
-  return actions.filter(action => (AllSupportedAction as string[]).includes(action)) as SupportedActionType[];
+  return actions.filter(action => (AllSupportedActions as string[]).includes(action)) as SupportedActionType[];
 };
 
 class ActivityService {