Skip to content

Commit a2a4874

Browse files
committed
SBERDOMA-347 refactored variable names in changeTrackable
1 parent daa5be7 commit a2a4874

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

apps/condo/domains/common/utils/serverSchema/changeTrackable.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,25 @@ class ResolversValidationError extends Error {
131131
* })
132132
*
133133
* @param {Object} fields - `fields` object of a Keystone schema
134+
* @param {Object} singleRelationshipDisplayNameResolvers - map of field names to functions, that resolves display name of "single" relationship for that field
135+
* @param {Object} manyRelationshipDisplayNameResolvers - map of field names to functions, that resolves display name of "many" relationship for that field
134136
* @return {Object} - Set of fields, that should be substituted into a declaration of schema, that will store changes.
135137
*/
136138
function generateChangeTrackableFieldsFrom (
137139
fields,
138-
displayNameResolvers,
139-
relatedManyToManyResolvers
140+
singleRelationshipDisplayNameResolvers,
141+
manyRelationshipDisplayNameResolvers
140142
) {
141143
const scalars = transform(pickBy(fields, isScalar), mapScalars, {})
142144
const fieldsOfSingleRelations = pickBy(fields, isRelationSingle)
143145
const fieldsOfManyRelations = pickBy(fields, isRelationMany)
144146

145-
const fieldsWithoutRelationshipResolvers = [
146-
...keys(fieldsOfSingleRelations).filter(key => !displayNameResolvers[key]),
147-
...keys(fieldsOfManyRelations).filter(key => !relatedManyToManyResolvers[key]),
147+
const fieldsWithoutResolvers = [
148+
...keys(fieldsOfSingleRelations).filter(key => !singleRelationshipDisplayNameResolvers[key]),
149+
...keys(fieldsOfManyRelations).filter(key => !manyRelationshipDisplayNameResolvers[key]),
148150
]
149-
if (fieldsWithoutRelationshipResolvers.length > 0) {
150-
throw new ResolversValidationError(fieldsWithoutRelationshipResolvers)
151+
if (fieldsWithoutResolvers.length > 0) {
152+
throw new ResolversValidationError(fieldsWithoutResolvers)
151153
}
152154

153155
const mappedFieldsOfSingleRelationships = transform(fieldsOfSingleRelations, mapRelationSingle, {})

0 commit comments

Comments
 (0)