Hoist log export WalkAll order to package vars
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
@@ -74,6 +74,16 @@ var (
|
|||||||
"error_message",
|
"error_message",
|
||||||
"ip_address",
|
"ip_address",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auditLogExportOrderBy = page.OrderBy[coredata.AuditLogEntryOrderField]{
|
||||||
|
Field: coredata.AuditLogEntryOrderFieldCreatedAt,
|
||||||
|
Direction: page.OrderDirectionAsc,
|
||||||
|
}
|
||||||
|
|
||||||
|
scimEventExportOrderBy = page.OrderBy[coredata.SCIMEventOrderField]{
|
||||||
|
Field: coredata.SCIMEventOrderFieldCreatedAt,
|
||||||
|
Direction: page.OrderDirectionAsc,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *LogExportService) streamAuditLogCSV(
|
func (s *LogExportService) streamAuditLogCSV(
|
||||||
@@ -91,10 +101,7 @@ func (s *LogExportService) streamAuditLogCSV(
|
|||||||
|
|
||||||
return page.WalkAll(
|
return page.WalkAll(
|
||||||
ctx,
|
ctx,
|
||||||
page.OrderBy[coredata.AuditLogEntryOrderField]{
|
auditLogExportOrderBy,
|
||||||
Field: coredata.AuditLogEntryOrderFieldCreatedAt,
|
|
||||||
Direction: page.OrderDirectionAsc,
|
|
||||||
},
|
|
||||||
func(ctx context.Context, cursor *page.Cursor[coredata.AuditLogEntryOrderField]) (coredata.AuditLogEntries, error) {
|
func(ctx context.Context, cursor *page.Cursor[coredata.AuditLogEntryOrderField]) (coredata.AuditLogEntries, error) {
|
||||||
var logs coredata.AuditLogEntries
|
var logs coredata.AuditLogEntries
|
||||||
if err := logs.LoadByOrganizationID(
|
if err := logs.LoadByOrganizationID(
|
||||||
@@ -149,10 +156,7 @@ func (s *LogExportService) streamSCIMEventCSV(
|
|||||||
|
|
||||||
return page.WalkAll(
|
return page.WalkAll(
|
||||||
ctx,
|
ctx,
|
||||||
page.OrderBy[coredata.SCIMEventOrderField]{
|
scimEventExportOrderBy,
|
||||||
Field: coredata.SCIMEventOrderFieldCreatedAt,
|
|
||||||
Direction: page.OrderDirectionAsc,
|
|
||||||
},
|
|
||||||
func(ctx context.Context, cursor *page.Cursor[coredata.SCIMEventOrderField]) (coredata.SCIMEvents, error) {
|
func(ctx context.Context, cursor *page.Cursor[coredata.SCIMEventOrderField]) (coredata.SCIMEvents, error) {
|
||||||
var events coredata.SCIMEvents
|
var events coredata.SCIMEvents
|
||||||
if err := events.LoadByOrganizationID(
|
if err := events.LoadByOrganizationID(
|
||||||
|
|||||||
Reference in New Issue
Block a user