Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add state filter to list user orgs api #813

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TAG := $(shell git rev-list --tags --max-count=1)
VERSION := $(shell git describe --tags ${TAG})
.PHONY: build check fmt lint test test-race vet test-cover-html help install proto ui compose-up-dev
.DEFAULT_GOAL := build
PROTON_COMMIT := "145667ee53b037d636c09df0a529c351069132dc"
PROTON_COMMIT := "8c05fcc798a7893761c9df0410c8d92cc926f68a"

ui:
@echo " > generating ui build"
Expand Down
7 changes: 6 additions & 1 deletion internal/api/v1beta1/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,15 @@ func (h Handler) ListCurrentUserGroups(ctx context.Context, request *frontierv1b
}

func (h Handler) ListOrganizationsByUser(ctx context.Context, request *frontierv1beta1.ListOrganizationsByUserRequest) (*frontierv1beta1.ListOrganizationsByUserResponse, error) {
orgFilter := organization.Filter{}
if request.GetState() != "" {
orgFilter.State = organization.State(request.GetState())
}

orgList, err := h.orgService.ListByUser(ctx, authenticate.Principal{
ID: request.GetId(),
Type: schema.UserPrincipal,
}, organization.Filter{})
}, orgFilter)
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion proto/apidocs.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9389,6 +9389,10 @@ paths:
in: path
required: true
type: string
- name: state
in: query
required: false
type: string
tags:
- User
/v1beta1/users/{id}/preferences:
Expand Down Expand Up @@ -9973,7 +9977,7 @@ definitions:
`NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.

The JSON representation for `NullValue` is JSON `null`.
The JSON representation for `NullValue` is JSON `null`.

- NULL_VALUE: Null value.
rpcStatus:
Expand Down
Loading
Loading