1234567891011121314151617181920212223242526272829303132333435363738394041 |
- --- Remove org (consent)
- -- A simple module that calls a consent process on an org to remove it.
- -- Depends on the Consent module.
- local remove_org_consent = {
- name = "Remove this org",
- slug = "remove_org_consent",
- desc = "Removes an org if all members consent."
- }
- remove_org_consent.data = {
- }
- remove_org_consent.config = {
- }
- function remove_org_consent:initiate(result)
- self.org:call_module(
- "consent",
- self.initiator,
- {
- prompt = "Remove org " .. self.org.name .. "?",
- votes_required = #self.org.members
- },
- function ()
- self:complete()
- end
- )
- modpol.interactions.org_dashboard(
- self.initiator, self.org.name)
- if result then result() end
- end
- function remove_org_consent:complete()
- modpol.interactions.message_org(
- self.initiator, self.org.id,
- "Removing org: " .. self.org.name)
- self.org:delete()
- end
- modpol.modules.remove_org_consent = remove_org_consent
|