noosfero | Add support for get user membership state (!1228)
Leandro Nunes
gitlab at mg.gitlab.com
Mon Jun 5 11:16:26 BRT 2017
Leandro Nunes started a new discussion on app/api/v1/people.rb:
> present_partial current_person, :with => Entities::Person, :current_person => current_person
> end
> end
> +
> + resource :membership do
> + get do
> + organization = environment.profiles.find_by id: params[:profile_id]
> + person = environment.profiles.find_by identifier: params[:identifier]
> + output = {}
> +
> + if organization.already_request_membership?(person)
> + output[:membership_state] = 1
@maljunior please create a contant for membership states.
Something like MEMBERSHIP_PENDING, MEMBERSHIP_IS_MEMBER, MEMBERSHIP_NON_MEMBER on Organization class
---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1228#note_31536172
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170605/3678e78d/attachment.html>
More information about the Noosfero-dev
mailing list