You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
942 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <base-modal
  3. text="Add"
  4. :is-create="true"
  5. >
  6. <template v-slot="slotProps">
  7. <member-addition-form
  8. :add-member="addMember"
  9. :items="items"
  10. @close="slotProps.close"
  11. @search-user="searchUser"
  12. />
  13. </template>
  14. </base-modal>
  15. </template>
  16. <script>
  17. import { mapActions } from 'vuex'
  18. import BaseModal from '@/components/molecules/BaseModal'
  19. import MemberAdditionForm from '@/components/organisms/MemberAdditionForm'
  20. import UserService from '@/services/user.service'
  21. export default {
  22. components: {
  23. BaseModal,
  24. MemberAdditionForm
  25. },
  26. data() {
  27. return {
  28. items: []
  29. }
  30. },
  31. methods: {
  32. ...mapActions('members', ['addMember']),
  33. searchUser(username) {
  34. UserService.getUserList(username)
  35. .then((response) => {
  36. this.items = response
  37. })
  38. .catch((error) => {
  39. alert(error)
  40. })
  41. }
  42. }
  43. }
  44. </script>