Sha256: b37c680478253dafa141abdebb8db4919b5d24bdb700c55fa4a181240f45ee94
Contents?: true
Size: 847 Bytes
Versions: 18
Compression:
Stored size: 847 Bytes
Contents
!(angular => { 'use strict'; function QueryRequestTransformers() { const saveFields = ['id', 'title', 'body', 'tags', 'result_id', 'version', 'roles']; // see https://github.com/mbenford/ngTagsInput function transformNgTagsInput(fieldName, query) { let ngTags = query[fieldName]; if (_.exists(ngTags)) { query[fieldName] = _.map(ngTags, ngTagItem => _.exists(ngTagItem.text) ? ngTagItem.text : ngTagItem); } return query; } return [ query => transformNgTagsInput('tags', query), query => transformNgTagsInput('roles', query), query => { return { query: _.selectKeys(query, saveFields) }; }, angular.toJson ]; } angular.module('alephServices.queryRequestTransformers', []) .service('QueryRequestTransformers', QueryRequestTransformers); }(angular));
Version data entries
18 entries across 9 versions & 1 rubygems