Last active
September 19, 2016 09:53
-
-
Save myf9000/5038a7b3adc8871cf9cfd9c7e2967877 to your computer and use it in GitHub Desktop.
This file contains 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
desc "V3::Create a group" | |
params do | |
use :group_params | |
requires :send_group_invitation_email, | |
type: Boolean, | |
desc: "Send invitations to group users?" | |
optional :private, type: Boolean, default: false | |
end | |
post do | |
group_params = permitted_params.fetch(:group) | |
group_params[:organization_id] = current_organization.id | |
# sets group_params[:image] or group_params[:regular_image] to proper value | |
Activities::Shared.handle_image_change!(group_params) | |
created_group = action.call(permitted_params) | |
-> tu mi podeślesz to created group | |
group_representer_index.call(created_group) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment