1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00

Case insensitive table fetch

This commit is contained in:
Mel O'Hagan 2022-09-13 10:55:38 +01:00
parent 99c2a043b8
commit e53f7a1d28

View file

@ -58,7 +58,9 @@ exports.buildSchemaFromDb = async function (ctx) {
datasource.entities = {}
}
for (let key in tables) {
if (tablesFilter.includes(key)) {
if (
tablesFilter.some(filter => filter.toLowerCase() === key.toLowerCase())
) {
datasource.entities[key] = tables[key]
}
}
@ -237,7 +239,7 @@ const buildSchemaHelper = async datasource => {
await connector.buildSchema(datasource._id, datasource.entities)
// make sure they all have a display name selected
for (let entity of Object.values(datasource.entities)) {
for (let entity of Object.values(datasource.entities ?? {})) {
if (entity.primaryDisplay) {
continue
}