1
0
Fork 0
mirror of synced 2024-06-29 19:41:03 +12:00

Merge pull request #3025 from Budibase/fix/quick-fixes

Fixing refresh on wrong password and setting hard SQL limits
This commit is contained in:
Michael Drury 2021-10-18 09:20:29 +01:00 committed by GitHub
commit 34d5bca7c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 792 additions and 20 deletions

View file

@ -15,7 +15,7 @@ const apiCall =
if (resp.status === 403) {
removeCookie(Cookies.Auth)
// reload after removing cookie, go to login
if (!url.includes("self")) {
if (!url.includes("self") && !url.includes("login")) {
location.reload()
}
}

View file

@ -98,7 +98,9 @@ function addFilters(
}
function addRelationships(
knex: Knex,
query: KnexQuery,
fields: string | string[],
fromTable: string,
relationships: RelationshipsJson[] | undefined
): KnexQuery {
@ -114,7 +116,7 @@ function addRelationships(
query = query.leftJoin(
toTable,
`${fromTable}.${from}`,
`${relationship.tableName}.${to}`
`${toTable}.${to}`
)
} else {
const throughTable = relationship.through
@ -130,7 +132,7 @@ function addRelationships(
.leftJoin(toTable, `${toTable}.${toPrimary}`, `${throughTable}.${to}`)
}
}
return query
return query.limit(BASE_LIMIT)
}
function buildCreate(
@ -199,7 +201,7 @@ function buildRead(knex: Knex, json: QueryJson, limit: number): KnexQuery {
[tableName]: query,
}).select(selectStatement)
// handle joins
return addRelationships(preQuery, tableName, relationships)
return addRelationships(knex, preQuery, selectStatement, tableName, relationships)
}
function buildUpdate(

File diff suppressed because it is too large Load diff