Skip to content

Instantly share code, notes, and snippets.

@myf9000
Last active September 19, 2016 09:53
Show Gist options
  • Save myf9000/5038a7b3adc8871cf9cfd9c7e2967877 to your computer and use it in GitHub Desktop.
Save myf9000/5038a7b3adc8871cf9cfd9c7e2967877 to your computer and use it in GitHub Desktop.
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