From 7f30fdf882711a77052d42068dcb02dc2234d75f Mon Sep 17 00:00:00 2001 From: farhantock Date: Tue, 5 Dec 2023 13:55:04 +0700 Subject: [PATCH] role with all project --- src/views/Master/MasterRoles/DialogForm.js | 30 ++++++++++++++++++---- src/views/Master/MasterRoles/index.js | 6 +++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/views/Master/MasterRoles/DialogForm.js b/src/views/Master/MasterRoles/DialogForm.js index fab37b4..6433a7f 100644 --- a/src/views/Master/MasterRoles/DialogForm.js +++ b/src/views/Master/MasterRoles/DialogForm.js @@ -29,6 +29,7 @@ class DialogForm extends Component { isParentClick: false, menu: [], selectedMenu: null, + all_project: false, company_id } } @@ -53,7 +54,8 @@ class DialogForm extends Component { id: 0, name: "", description: "", - selectedMenu: null + selectedMenu: null, + company_id }) } this.setState({ isParentClick: false }); @@ -99,7 +101,8 @@ class DialogForm extends Component { name, description, selectedMenu, - company_id + company_id, + all_project } = this.state let data = ''; @@ -111,7 +114,8 @@ class DialogForm extends Component { name, description, selectedMenu, - company_id + company_id, + all_project } // console.log('data', data); this.props.closeDialog('save', data); @@ -121,7 +125,8 @@ class DialogForm extends Component { name, description, selectedMenu, - company_id + company_id, + all_project } this.props.closeDialog('edit', data); } @@ -173,7 +178,22 @@ class DialogForm extends Component { - + + this.setState({ all_project: e.target.checked })} + type="checkbox" + /> + + + ) } diff --git a/src/views/Master/MasterRoles/index.js b/src/views/Master/MasterRoles/index.js index 360b0f3..ddd84da 100644 --- a/src/views/Master/MasterRoles/index.js +++ b/src/views/Master/MasterRoles/index.js @@ -198,7 +198,8 @@ class index extends Component { name: data.name, description: data.description, default_page: data.selectedMenu, - company_id: data.company_id + company_id: data.company_id, + all_project: data.all_project } const result = await axios.post(ROLE_ADD, formData, this.config) @@ -219,7 +220,8 @@ class index extends Component { name: data.name, description: data.description, default_page: data.selectedMenu, - company_id: data.company_id + company_id: data.company_id, + all_project: data.all_project } const url = ROLE_EDIT(data.id) const result = await axios.put(url, formData, this.config)