~netlandish/links

49656ca9cfbfedb5e719d6469fa3b36741d96d14 — Peter Sanchez 29 days ago 865b024
Moving cursor check to be more effective
1 files changed, 6 insertions(+), 6 deletions(-)

M api/graph/schema.resolvers.go
M api/graph/schema.resolvers.go => api/graph/schema.resolvers.go +6 -6
@@ 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,