微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用safefilters查询撇号给我一个错误TypeError:无法将属性'safeFor'设置为未定义

如何解决使用safefilters查询撇号给我一个错误TypeError:无法将属性'safeFor'设置为未定义

我正试图使所有员工都从撇号的头脑中消失。我是cms和撇号的新手。当我在safeFilters中添加管理器时,出现TypeError错误:无法设置未定义的属性'safeFor'。但是,如果我删除管理器,它就可以正常工作。我尝试从邮递员执行的api是api/v1/Employees?manager=James。我在做什么错了?

我的员工作品index.js是。

module.exports = 
    {
        name: 'employee',extend: 'apostrophe-pieces',label: 'Employee',pluralLabel: 'Employees',restApi: {
            maxPerPage: 50,safeFilters: [ 'firstName','lastName','manager']
        },addFields: 
            [
                {
                    name: 'title',label: 'Full Name',type: 'string',required: true,contextual: true
                },{
                    name: 'firstName',label: 'First Name',required: true
                },{
                    name: 'lastName',label: 'Last Name',{
                    name: 'body',label: 'Biography',type: 'area',options: {
                        widgets: {
                            'apostrophe-rich-text': {
                                toolbar: [ 'Bold','Italic','Link','Unlink' ]
                            },'apostrophe-images': {}
                        }
                    }
                },{
                    name: 'manager',label: 'Manager',type: 'singleton',widgetType: 'employees',},{
                    name: 'phone',label: 'Phone',type: 'string'
                },{
                    name: 'thumbnail',label: 'Thumbnail',widgetType: 'apostrophe-images',options: {
                        limit: 1,minSize: [ 200,200 ],aspectRatio: [ 1,1 ]
                    }
                }
            ],arrangeFields: 
            [
                {
                    name: 'contact',label: 'Contact',fields: [ 'firstName','phone','manager' ]
                },{
                    name: 'admin',label: 'Administrative',fields: [ 'slug','published','tags' ]
                },{
                    name: 'content',label: 'Biographical',fields: [ 'thumbnail','body' ]
                }
            ],construct: function(self,options) {
            self.beforeSave = function(req,piece,options,callback) {
                piece.title = piece.firstName + ' ' + piece.lastName;
                return callback();
            };
        }
      
    };

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。