Commit a6ad5deb authored by syadziy's avatar syadziy

update fixing UAT

parent ed408605
......@@ -184,17 +184,19 @@ export default class CarfmDocument extends Component {
}
createDocument(payload) { //upload apinya disini
this.setState({ loading: true })
this.setState({ loading: true, visibleTrue: false })
api.create().uploadCarfmDocument(payload).then(response => {
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.message === "Data was Saved Successfully") {
this.setState({ visibleCreate: false, loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success'})
this.setState({ visibleCreate: false, visibleTrue: true, loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success'}, () => {
// window.location.reload();
})
// this.getDataCarfm('create')
}
else {
this.setState({ visibleCreate: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
this.setState({ visibleCreate: false, visibleTrue: true, alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -204,10 +206,10 @@ export default class CarfmDocument extends Component {
})
}
} else {
this.setState({ visibleCreate: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
this.setState({ visibleCreate: false, visibleTrue: true, alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ visibleCreate: false, alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ visibleCreate: false, visibleTrue: true, alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -35,8 +35,8 @@ export default class TableDocument extends Component {
}
componentWillReceiveProps(props) {
// console.log(props);
const { refresh} = this.props;
console.log(props);
const {refresh} = this.props;
if (props.refresh !== refresh) {
this.getData()
}
......@@ -139,7 +139,6 @@ export default class TableDocument extends Component {
sort: false,
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{this.props.btndownload && <a data-tip={'Download'} data-for="download">
......@@ -155,9 +154,7 @@ export default class TableDocument extends Component {
<img src={Images.download} />
</button>
</a>}
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div >
);
}
......
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