feat: expose groups and vpns related list APIs#216
Open
rahmatrhd wants to merge 7 commits intogate-sso:masterfrom
Open
feat: expose groups and vpns related list APIs#216rahmatrhd wants to merge 7 commits intogate-sso:masterfrom
rahmatrhd wants to merge 7 commits intogate-sso:masterfrom
Conversation
ayushi0014
reviewed
Jul 16, 2024
|
|
||
| def list_admins | ||
| group = Group.find(params[:id]) | ||
| users = group.group_admins.joins(:user). |
There was a problem hiding this comment.
can we also check if users in group_admins are not inactive. and if inactive users are there can we filter them out?
ayushi0014
reviewed
Jul 16, 2024
| @@ -1,4 +1,9 @@ | |||
| class ::Api::V1::GroupsController < ::Api::V1::BaseController | |||
| def index | |||
| groups = Group.order(:id).page(params[:page]).per(params[:per_page]) | |||
There was a problem hiding this comment.
let's add the default page and per_page if it's not provided by user
ayushi0014
reviewed
Jul 16, 2024
| before_action :set_vpn, only: [:assign_group] | ||
|
|
||
| def index | ||
| vpns = Vpn.order(:id).page(params[:page]).per(params[:per_page]) |
There was a problem hiding this comment.
same here, default page and per_page in case not present in request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New APIs
/api/v1/groups?page=1&per_page=10/api/v1/groups/:id/vpns/api/v1/groups/:id/admins/api/v1/vpns?page=1&per_page=10/api/v1/vpns/:id/groups