Commit 7a7673c6 authored by syadziy's avatar syadziy

update issue loading

parent bec3cb35
...@@ -464,10 +464,11 @@ export default class UserRole extends Component { ...@@ -464,10 +464,11 @@ export default class UserRole extends Component {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }, () => {
this.getUser() this.closeEdit()
this.closeEdit() window.location.reload();
window.location.reload(); })
// this.getUser()
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
...@@ -495,9 +496,10 @@ export default class UserRole extends Component { ...@@ -495,9 +496,10 @@ export default class UserRole extends Component {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', add: false }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', add: false }, () => {
this.getUser() window.location.reload();
window.location.reload(); })
// this.getUser()
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......
...@@ -141,7 +141,7 @@ export default class AddRole extends Component { ...@@ -141,7 +141,7 @@ export default class AddRole extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
setTimeout(() => { setTimeout(() => {
this.props.onClickClose() this.props.onClickClose()
this.props.refresh() // this.props.refresh()
window.location.reload(); window.location.reload();
}, 750); }, 750);
} else { } else {
......
...@@ -169,7 +169,7 @@ export default class EditRole extends Component { ...@@ -169,7 +169,7 @@ export default class EditRole extends Component {
setTimeout(() => { setTimeout(() => {
this.props.onClickClose() this.props.onClickClose()
window.location.reload(); window.location.reload();
this.props.refresh() // this.props.refresh()
}, 750); }, 750);
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment