mirror of
https://github.com/outbackdingo/pangolin.git
synced 2026-01-27 10:20:03 +00:00
Also order by id
This commit is contained in:
@@ -124,7 +124,7 @@ export function queryAccess(data: Q) {
|
||||
eq(accessAuditLog.resourceId, resources.resourceId)
|
||||
)
|
||||
.where(getWhere(data))
|
||||
.orderBy(desc(accessAuditLog.timestamp));
|
||||
.orderBy(desc(accessAuditLog.timestamp), desc(accessAuditLog.id));
|
||||
}
|
||||
|
||||
export function countAccessQuery(data: Q) {
|
||||
|
||||
@@ -92,7 +92,7 @@ export function queryAction(data: Q) {
|
||||
})
|
||||
.from(actionAuditLog)
|
||||
.where(getWhere(data))
|
||||
.orderBy(desc(actionAuditLog.timestamp));
|
||||
.orderBy(desc(actionAuditLog.timestamp), desc(actionAuditLog.id));
|
||||
}
|
||||
|
||||
export function countActionQuery(data: Q) {
|
||||
|
||||
@@ -94,6 +94,7 @@ function getWhere(data: Q) {
|
||||
export function queryRequest(data: Q) {
|
||||
return db
|
||||
.select({
|
||||
id: requestAuditLog.id,
|
||||
timestamp: requestAuditLog.timestamp,
|
||||
orgId: requestAuditLog.orgId,
|
||||
action: requestAuditLog.action,
|
||||
@@ -123,7 +124,7 @@ export function queryRequest(data: Q) {
|
||||
eq(requestAuditLog.resourceId, resources.resourceId)
|
||||
) // TODO: Is this efficient?
|
||||
.where(getWhere(data))
|
||||
.orderBy(desc(requestAuditLog.timestamp));
|
||||
.orderBy(desc(requestAuditLog.timestamp), desc(requestAuditLog.id));
|
||||
}
|
||||
|
||||
export function countRequestQuery(data: Q) {
|
||||
|
||||
Reference in New Issue
Block a user