mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
fix orderby being rewritten in most freq query (#22905)
This commit is contained in:
1 parent
41a1737a9a
commit
c679d1cfc8
1 file changed
+2
-2
@@ -23,7 +23,7 @@ type QueryPerformanceQueryOpts = {
|
||||
|
||||
export const useQueryPerformanceQuery = ({
|
||||
preset,
|
||||
orderBy = { column: 'total_time', order: 'desc' },
|
||||
orderBy,
|
||||
searchQuery = '',
|
||||
roles,
|
||||
}: QueryPerformanceQueryOpts) => {
|
||||
@@ -39,7 +39,7 @@ export const useQueryPerformanceQuery = ({
|
||||
.filter((x) => x.length > 0)
|
||||
.join(' OR ')
|
||||
|
||||
const orderBySql = `ORDER BY ${orderBy.column} ${orderBy.order}`
|
||||
const orderBySql = orderBy && `ORDER BY ${orderBy.column} ${orderBy.order}`
|
||||
const sql = baseSQL.sql([], whereSql.length > 0 ? `WHERE ${whereSql}` : undefined, orderBySql)
|
||||
return useDbQuery(sql, undefined, whereSql, orderBySql)
|
||||
}
|
||||
Reference in new issue
Block a user