Taichi Masuyama 4 лет назад
Родитель
Сommit
504c6c26da

+ 2 - 2
packages/app/src/interfaces/named-query.ts

@@ -1,13 +1,13 @@
 import { IUser } from './user';
 
 
-export enum SearchResolverName {
+export enum SearchDelegatorName {
   DEFAULT = 'FullTextSearch',
   PRIVATE_LEGACY_PAGES = 'PrivateLegacyPages',
 }
 export interface INamedQuery {
   name: string
   aliasOf?: string
-  resolverName?: SearchResolverName
+  delegatorName?: SearchDelegatorName
   creator?: IUser
 }

+ 4 - 4
packages/app/src/server/models/named-query.ts

@@ -6,7 +6,7 @@ import mongoose, {
 
 import { getOrCreateModel } from '@growi/core';
 import loggerFactory from '../../utils/logger';
-import { INamedQuery, SearchResolverName } from '../../interfaces/named-query';
+import { INamedQuery, SearchDelegatorName } from '../../interfaces/named-query';
 
 const logger = loggerFactory('growi:models:named-query');
 
@@ -19,15 +19,15 @@ const ObjectId = mongoose.Schema.Types.ObjectId;
 const schema = new Schema<NamedQueryDocument, NamedQueryModel>({
   name: { type: String, required: true, unique: true },
   aliasOf: { type: String },
-  resolverName: { type: String, enum: SearchResolverName },
+  delegatorName: { type: String, enum: SearchDelegatorName },
   creator: {
     type: ObjectId, ref: 'User', index: true, default: null,
   },
 });
 
 schema.pre('validate', async function(this, next) {
-  if (this.aliasOf == null && this.resolverName == null) {
-    throw Error('Either of aliasOf and resolverName must not be null.');
+  if (this.aliasOf == null && this.delegatorName == null) {
+    throw Error('Either of aliasOf and delegatorNameName must not be null.');
   }
 
   next();