Commit 35ed8ee7 authored by EKSAD's avatar EKSAD

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 3a36d3ae 69f1194b
...@@ -92,8 +92,8 @@ export default class ApprovalMatrix extends Component { ...@@ -92,8 +92,8 @@ export default class ApprovalMatrix extends Component {
let body = { let body = {
approval_matrix: payload approval_matrix: payload
} }
console.log(resp.rows[1])
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
console.log(this.state.payload)
} }
}); });
} }
...@@ -621,7 +621,7 @@ export default class ApprovalMatrix extends Component { ...@@ -621,7 +621,7 @@ export default class ApprovalMatrix extends Component {
filter: false, filter: false,
sort: false, sort: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
console.log(tableMeta) // console.log(tableMeta)
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.btnedit && <span> {this.state.btnedit && <span>
......
This diff is collapsed.
...@@ -64,7 +64,7 @@ export default class CreateManagementDoc extends Component { ...@@ -64,7 +64,7 @@ export default class CreateManagementDoc extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
sizeUpload: response.data.data[0].value sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
}) })
} }
} }
......
...@@ -66,7 +66,7 @@ export default class EditManagementDoc extends Component { ...@@ -66,7 +66,7 @@ export default class EditManagementDoc extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
sizeUpload: response.data.data[0].value sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
}) })
} }
} }
...@@ -88,6 +88,7 @@ export default class EditManagementDoc extends Component { ...@@ -88,6 +88,7 @@ export default class EditManagementDoc extends Component {
period: data.document_periode, period: data.document_periode,
getMonthName: data.document_month, getMonthName: data.document_month,
description: data.description, description: data.description,
filePath: data.document_filepath,
file: data.document_filepath, file: data.document_filepath,
document_name: data.document_name, document_name: data.document_name,
document_size: data.document_size, document_size: data.document_size,
...@@ -279,6 +280,10 @@ export default class EditManagementDoc extends Component { ...@@ -279,6 +280,10 @@ export default class EditManagementDoc extends Component {
// this.setState({ errorDocument: true, msgErrorDocument: 'File Cannot be Empty' }) // this.setState({ errorDocument: true, msgErrorDocument: 'File Cannot be Empty' })
} else { } else {
const formData = new FormData(); const formData = new FormData();
if (this.state.file == this.state.filePath){
formData.append("updated", 0);
}
formData.append("updated", 1);
formData.append("file", this.state.file); formData.append("file", this.state.file);
formData.append("companyId", this.state.getPerusahaan.company_id); formData.append("companyId", this.state.getPerusahaan.company_id);
formData.append("settingId", this.state.getDocument.document_category_id); formData.append("settingId", this.state.getDocument.document_category_id);
...@@ -290,6 +295,7 @@ export default class EditManagementDoc extends Component { ...@@ -290,6 +295,7 @@ export default class EditManagementDoc extends Component {
this.setState({ formData }, () => { this.setState({ formData }, () => {
this.props.updateDocument(this.state.formData) this.props.updateDocument(this.state.formData)
}) })
console.log(JSON.stringify(formData))
} }
} }
......
...@@ -69,11 +69,11 @@ export default class Parameter extends Component { ...@@ -69,11 +69,11 @@ export default class Parameter extends Component {
type: 'MAX_FILE_SIZE' type: 'MAX_FILE_SIZE'
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(body).then(response => {
console.log(response); console.log(response.data.data[0]);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
sizeUpload: response.data.data[0].value sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
}) })
} }
} }
......
...@@ -240,7 +240,7 @@ export default class UnitBisnis extends Component { ...@@ -240,7 +240,7 @@ export default class UnitBisnis extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
sizeUpload: response.data.data[0].value sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
}) })
} }
} }
......
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