remove_org.lua 660 B

123456789101112131415161718192021222324252627
  1. --- @module Remove Org
  2. -- A simple module that calls a consent process on an org to remove it.
  3. --- Main module table
  4. remove_org = {
  5. name = "Remove this org",
  6. slug = "remove_org",
  7. desc = "Removes an org if all members consent."
  8. }
  9. remove_org.config = {}
  10. remove_org.data = {}
  11. --- Initiate function
  12. -- @function initiate
  13. function remove_org:initiate(config, result)
  14. modpol.interactions.message_org(
  15. self.initiator,self.org.id,
  16. "Removing org: "..self.org.name)
  17. self.org:delete()
  18. modpol.interactions.dashboard(self.initiator)
  19. -- call result function
  20. if result then result() end
  21. end
  22. modpol.modules.remove_org = remove_org