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.
 
 
 
 
 
 

59 lines
1.1 KiB

<template>
<base-modal
:is-create="true"
text="Add"
>
<template v-slot="slotProps">
<member-addition-form
:add-member="addMember"
:items="items"
:roles="roles"
@close="slotProps.close"
@search-user="searchUser"
/>
</template>
</base-modal>
</template>
<script>
import { mapActions, mapGetters } from 'vuex'
import BaseModal from '@/components/molecules/BaseModal'
import MemberAdditionForm from '@/components/organisms/members/MemberAdditionForm'
import UserService from '@/services/user.service'
export default {
components: {
BaseModal,
MemberAdditionForm
},
data() {
return {
items: []
}
},
computed: {
...mapGetters('roles', ['roles'])
},
created() {
this.getRoleList()
},
methods: {
...mapActions('members', ['addMember']),
...mapActions('roles', ['getRoleList']),
searchUser(username) {
UserService.getUserList(username)
.then((response) => {
this.items = response.data
})
.catch((error) => {
alert(error)
})
}
}
}
</script>