1
0
Fork 0
mirror of synced 2024-07-08 15:56:23 +12:00

Case insensitive table fetch

This commit is contained in:
Mel O'Hagan 2022-09-13 10:55:38 +01:00
parent fb51090752
commit 6e29e0a757

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
}