@live-change/relations-plugin 0.8.113 → 0.8.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/utils.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/relations-plugin",
3
- "version": "0.8.113",
3
+ "version": "0.8.115",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@live-change/framework": "^0.8.113",
25
+ "@live-change/framework": "^0.8.115",
26
26
  "pluralize": "^8.0.0"
27
27
  },
28
- "gitHead": "80dd8415e06d849cc00a7711c635a7388143ce1d"
28
+ "gitHead": "fc360f214e2cd529db9e5795849005a563cb6866"
29
29
  }
package/utils.js CHANGED
@@ -50,12 +50,13 @@ export function defineIndex(model, what, props) {
50
50
  export function defineIndexes(model, props, types) {
51
51
  console.log("DEFINE INDEXES", model.name, props, types)
52
52
  const propCombinations = allCombinations(Object.keys(props))
53
+ console.log("COMBINATIONS", propCombinations)
53
54
  for(const propCombination of propCombinations) {
54
55
  const upperCaseProps = propCombination.map(id => {
55
56
  const prop = props[id]
56
57
  return prop[0].toUpperCase() + prop.slice(1)
57
58
  })
58
- defineIndex(model, upperCaseProps.join('And'), props[propCombination])
59
+ defineIndex(model, upperCaseProps.join('And'), props[propCombination]) // it's ok!
59
60
  }
60
61
  }
61
62
 
@@ -106,7 +107,8 @@ export function processModelsAnnotation(service, app, annotation, multiple, cb)
106
107
 
107
108
  const writeableProperties = modelProperties || config.writeableProperties
108
109
  const otherNames = what.map(other => other.name ? other.name : other)
109
- const otherPropertyNames = otherNames.map(name => name[0].toLowerCase() + name.slice(1))
110
+ const otherPropertyNames = config.propertyNames
111
+ ?? otherNames.map(name => name[0].toLowerCase() + name.slice(1))
110
112
 
111
113
  const joinedOthersPropertyName = (otherNames[0][0].toLowerCase() + otherNames[0].slice(1)) +
112
114
  (otherNames.length > 1 ? ('And' + otherNames.slice(1).join('And')) : '')