3
0

Includes disabled entries to APIGw list call

For APIgw route and filter List API assigned default value 1 to `disabled` filter
This commit is contained in:
Vivek Patel 2021-10-05 16:13:58 +05:30
parent a22083573c
commit 955ea9c0fa
3 changed files with 11 additions and 6 deletions

View File

@ -49,9 +49,12 @@ func (ctrl *ApigwFilter) List(ctx context.Context, r *request.ApigwFilterList) (
var ( var (
err error err error
f = types.ApigwFilterFilter{ f = types.ApigwFilterFilter{
RouteID: r.RouteID, RouteID: r.RouteID,
Deleted: filter.State(r.Deleted), Deleted: filter.State(r.Deleted),
Disabled: filter.State(r.Disabled),
// todo: this should dynamic as Delete
// but making it default to `1`, until UI is aligned with this
Disabled: filter.StateInclusive,
} }
) )

View File

@ -46,8 +46,11 @@ func (ctrl *ApigwRoute) List(ctx context.Context, r *request.ApigwRouteList) (in
var ( var (
err error err error
f = types.ApigwRouteFilter{ f = types.ApigwRouteFilter{
Deleted: filter.State(r.Deleted), Deleted: filter.State(r.Deleted),
Disabled: filter.State(r.Disabled),
// todo: this should dynamic as Delete
// but making it default to `1`, until UI is aligned with this
Disabled: filter.StateInclusive,
} }
) )

View File

@ -104,7 +104,6 @@ func TestApigwRouteSearch(t *testing.T) {
h.createRouteWithFilter("test1", "") h.createRouteWithFilter("test1", "")
h.createRouteWithFilter("test2", "") h.createRouteWithFilter("test2", "")
h.createRouteAndFilterWithEnabled("test3", "", false, true)
helpers.AllowMe(h, types.ComponentRbacResource(), "apigw-routes.search") helpers.AllowMe(h, types.ComponentRbacResource(), "apigw-routes.search")
helpers.AllowMe(h, types.ApigwRouteRbacResource(0), "read") helpers.AllowMe(h, types.ApigwRouteRbacResource(0), "read")