@kaspernj/api-maker 1.0.386 → 1.0.387

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaspernj/api-maker",
3
- "version": "1.0.386",
3
+ "version": "1.0.387",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -28,5 +28,6 @@ export default class ApiMakerBaseModelAttribute {
28
28
  return false
29
29
  }
30
30
 
31
+ isTranslated = () => digg(this, "attributeData", "translated")
31
32
  name = () => digg(this, "attributeData", "name")
32
33
  }
@@ -60,14 +60,20 @@ export default class ApiMakerSuperAdminConfigReader {
60
60
  const columns = []
61
61
 
62
62
  for (const attribute of attributes) {
63
- if (!attribute.isSelectedByDefault()) continue
63
+ if (!attribute.isSelectedByDefault() && attribute.name() != "name") {
64
+ continue
65
+ }
64
66
 
65
67
  const camelizedName = inflection.camelize(attribute.name(), true)
66
68
  const column = {
67
69
  attribute: camelizedName
68
70
  }
69
71
 
70
- if (attribute.isColumn()) column.sortKey = camelizedName
72
+ if (attribute.isColumn()) {
73
+ column.sortKey = camelizedName
74
+ } else if (attribute.isTranslated()) {
75
+ column.sortKey = `currentTranslation${camelizedName}`
76
+ }
71
77
 
72
78
  columns.push(column)
73
79
  }