Skip to content

Commit

Permalink
feat: add state filter to list user orgs api (#813)
Browse files Browse the repository at this point in the history
* feat: add state filter to list user orgs api

* fix: lint issue
  • Loading branch information
rsbh authored Nov 8, 2024
1 parent 3bd93db commit 2c3acc1
Show file tree
Hide file tree
Showing 6 changed files with 5,043 additions and 5,005 deletions.
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

0 comments on commit 2c3acc1

Please sign in to comment.