From c388f893c1e01af5f039f0e3960acf58cfd2425b Mon Sep 17 00:00:00 2001 From: Peter Grlica Date: Mon, 18 Oct 2021 12:07:54 +0200 Subject: [PATCH] Added sorting fields to integration gateway --- store/apigw_route.yaml | 10 +++++----- store/rdbms/apigw_route.gen.go | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/store/apigw_route.yaml b/store/apigw_route.yaml index bccb05f67..8eba8f4f1 100644 --- a/store/apigw_route.yaml +++ b/store/apigw_route.yaml @@ -8,17 +8,17 @@ types: fields: - { field: ID, sortable: false } - - { field: Endpoint } - - { field: Method } + - { field: Endpoint, sortable: true } + - { field: Method, sortable: true } - { field: Enabled } - { field: Group } - { field: Meta, type: "types.ApigwRouteMeta" } - { field: CreatedBy } - { field: UpdatedBy } - { field: DeletedBy } - - { field: CreatedAt } - - { field: UpdatedAt } - - { field: DeletedAt } + - { field: CreatedAt, sortable: true } + - { field: UpdatedAt, sortable: true } + - { field: DeletedAt, sortable: true } lookups: - fields: [ ID ] diff --git a/store/rdbms/apigw_route.gen.go b/store/rdbms/apigw_route.gen.go index 006f38b84..4994e3e2b 100644 --- a/store/rdbms/apigw_route.gen.go +++ b/store/rdbms/apigw_route.gen.go @@ -482,7 +482,12 @@ func (Store) apigwRouteColumns(aa ...string) []string { // With optional string arg, all columns are returned aliased func (Store) sortableApigwRouteColumns() map[string]string { return map[string]string{ - "id": "id", + "id": "id", "endpoint": "endpoint", "method": "method", "created_at": "created_at", + "createdat": "created_at", + "updated_at": "updated_at", + "updatedat": "updated_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", } } @@ -533,6 +538,20 @@ func (s Store) collectApigwRouteCursorValues(res *types.ApigwRoute, cc ...*filte cursor.Set(c.Column, res.ID, c.Descending) pkId = true + case "endpoint": + cursor.Set(c.Column, res.Endpoint, c.Descending) + + case "method": + cursor.Set(c.Column, res.Method, c.Descending) + + case "created_at": + cursor.Set(c.Column, res.CreatedAt, c.Descending) + + case "updated_at": + cursor.Set(c.Column, res.UpdatedAt, c.Descending) + + case "deleted_at": + cursor.Set(c.Column, res.DeletedAt, c.Descending) } }