add_child_org.lua 731 B

1234567891011121314151617181920212223242526272829
  1. --- @module add_child_org
  2. -- Adds a child org
  3. local add_child_org = {
  4. name = "Add child org",
  5. slug = "add_child_org",
  6. desc = "Create a child org within the current one"
  7. }
  8. add_child_org.data = {
  9. }
  10. add_child_org.config = {
  11. }
  12. -- @function initiate
  13. function add_child_org:initiate(result)
  14. modpol.interactions.text_query(
  15. self.initiator,"Child org name: ",
  16. function(input)
  17. self.org:add_org(input, self.initiator)
  18. modpol.interactions.message_org(
  19. self.initiator,
  20. self.org.id,
  21. "Child org created: "..input)
  22. modpol.interactions.dashboard(self.initiator)
  23. end)
  24. end
  25. --- (Required) Add to module table
  26. modpol.modules.add_child_org = add_child_org