Commit 80e2cf57 authored by muhammad ridwan's avatar muhammad ridwan

bug fixing v1

parent 58dc11d4
......@@ -26,7 +26,7 @@ export default class CarfmDocument extends Component {
load: false,
name: '',
userCompActive: [],
isHasAccessDocument: false,
isHasAccessDocument: true,
submenu_id : 0,
submenu_name: "",
menu_title: ""
......@@ -38,8 +38,8 @@ export default class CarfmDocument extends Component {
// this.getPermission()
await this.getMenuName();
this.getDataCarfm();
this.getDetailUser();
await this.getDataCarfm();
await this.getDetailUser();
}
......@@ -68,11 +68,11 @@ export default class CarfmDocument extends Component {
)
}
getDataCarfm(create){
async getDataCarfm(create){
let payload = {
submenu_id : this.state.submenu_id
}
api.create().getCarfmDocumentBySubmenu(payload).then(
await api.create().getCarfmDocumentBySubmenu(payload).then(
response => {
if(response){
if(response.data.status === 'success'){
......@@ -112,11 +112,11 @@ export default class CarfmDocument extends Component {
)
}
getPermission(subMenu) {
async getPermission(subMenu) {
let payload = {
menu: subMenu
}
api.create().getPermission(payload).then(response => {
await api.create().getPermission(payload).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -137,9 +137,9 @@ export default class CarfmDocument extends Component {
})
}
getDetailUser() {
async getDetailUser() {
let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => {
await api.create().getDetailUser(userId).then((response) => {
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
......@@ -153,8 +153,8 @@ export default class CarfmDocument extends Component {
})
}
getCompanyActive() {
api.create().getPerusahaanActive().then((response) => {
async getCompanyActive() {
await api.create().getPerusahaanActive().then((response) => {
console.log("getcompanyactive start");
console.log(response);
console.log("getcompanyactive stop");
......@@ -198,13 +198,13 @@ export default class CarfmDocument extends Component {
})
}
createUploadDocument() {
async createUploadDocument() {
this.setState({ visibleCreate: false, konfirmasi: false })
const formData = this.state.formData
formData.append("documentId", this.state.docId)
formData.append("updated", 1)
this.setState({ loading: true })
api.create().updateDocument(formData).then(response => {
await api.create().updateDocument(formData).then(response => {
// console.log(response)
if (response.data) {
if (response.ok) {
......@@ -230,9 +230,9 @@ export default class CarfmDocument extends Component {
})
}
createDocument(payload) { //upload apinya disini
async createDocument(payload) { //upload apinya disini
this.setState({ loading: true })
api.create().uploadCarfmDocument(payload).then(response => {
await api.create().uploadCarfmDocument(payload).then(response => {
// console.log(response)
if (response.data) {
if (response.ok) {
......
......@@ -53,21 +53,21 @@ export default class CreateCarfmDoc extends Component {
}
}
componentDidMount() {
this.getDataCompany()
this.getPeriode()
this.getMonth()
this.getFileSize()
this.getMenuName()
async componentDidMount() {
await this.getMenuName()
await this.getDataCompany()
await this.getPeriode()
await this.getMonth()
await this.getFileSize()
}
getFileSize() {
async getFileSize() {
let body = {
group: 'MAX_FILE_SIZE',
company_id: 0,
type: 'MAX_FILE_SIZE'
}
api.create().getAllSettingByType(body).then(response => {
await api.create().getAllSettingByType(body).then(response => {
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
......@@ -95,8 +95,8 @@ export default class CreateCarfmDoc extends Component {
})
}
getDataCompany() {
api.create().getPerusahaanUserActive().then((response) => {
async getDataCompany() {
await api.create().getPerusahaanUserActive().then((response) => {
if (response.data) {
if (response.data.status == 'success') {
let data = response.data.data
......@@ -131,9 +131,9 @@ export default class CreateCarfmDoc extends Component {
})
}
getMenuName(){
async getMenuName(){
api.create().getMenuByUser().then(
await api.create().getMenuByUser().then(
response => {
if(response.data){
if(response.data.status === 'success'){
......@@ -153,8 +153,8 @@ export default class CreateCarfmDoc extends Component {
)
}
getPeriode() {
api.create().getPeriodeTransaction().then(response => {
async getPeriode() {
await api.create().getPeriodeTransaction().then(response => {
let dateNow = new Date
let year = format(dateNow, 'yyyy')
if (response.data) {
......@@ -185,8 +185,8 @@ export default class CreateCarfmDoc extends Component {
})
}
getMonth() {
api.create().getMonthTransaction().then(response => {
async getMonth() {
await api.create().getMonthTransaction().then(response => {
let dateNow = new Date
// let bulan = format(dateNow, 'MMMM')
if (response.data) {
......
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