From 49656ca9cfbfedb5e719d6469fa3b36741d96d14 Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Wed, 27 Nov 2024 16:41:24 -0600 Subject: [PATCH] Moving cursor check to be more effective --- api/graph/schema.resolvers.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/graph/schema.resolvers.go b/api/graph/schema.resolvers.go index af91328..5a716a4 100644 --- a/api/graph/schema.resolvers.go +++ b/api/graph/schema.resolvers.go @@ -6299,6 +6299,12 @@ func (r *queryResolver) GetAdminOrganizations(ctx context.Context, input *model. return nil, nil } + if input.After != nil && input.Before != nil { + validator.Error(lt.Translate("You can not send both after and before cursors")). + WithCode(valid.ErrValidationGlobalCode) + return nil, nil + } + opts := &database.FilterOptions{ Filter: sq.And{}, OrderBy: "o.id DESC", @@ -6314,12 +6320,6 @@ func (r *queryResolver) GetAdminOrganizations(ctx context.Context, input *model. } } - if input.After != nil && input.Before != nil { - validator.Error(lt.Translate("You can not send both after and before cursors")). - WithCode(valid.ErrValidationGlobalCode) - return nil, nil - } - if input.OwnerID != nil { opts.Filter = sq.And{ opts.Filter, -- 2.45.2