Commit c19cda7a authored by Deni Rinaldi's avatar Deni Rinaldi

getData

parent 1e809707
......@@ -28,8 +28,9 @@ export default class Appraisal extends Component {
getListAppraisal() {
this.setState({ loading: true })
// alert(this.props.navigation.state.params.data.value)
api.create().getListAppraisal({
warehouse_id: 2
warehouse_id: Number(this.props.navigation.state.params.data.value)
}).then((response) => {
// alert(JSON.stringify(response.data))
if (response.data.status == "success") {
......
......@@ -31,7 +31,7 @@ export default class Approval extends Component {
getListApproval() {
this.setState({ loading: true })
api.create().getListApproval({
warehouse_id: 2
warehouse_id: Number(this.props.navigation.state.params.data.value)
}).then((response) => {
reactotron.log(response.data)
if (response.data.status == "success") {
......@@ -64,7 +64,7 @@ export default class Approval extends Component {
return (
<Container style={{ flex: 1 }}>
<NavigationEvents
onDidFocus={() => this.getListAppraisal()}
onDidFocus={() => this.getListApproval()}
/>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listData.map((item, index) => {
......
......@@ -53,9 +53,9 @@ class HomePageScreen extends Component {
// alert('Select Warehouse First!')
}
} else if (item == 'Appraisal') {
this.props.navigation.navigate('Appraisal')
this.props.navigation.navigate('Appraisal', { data: this.state.selectedWarehouse })
} else {
this.props.navigation.navigate('Approval')
this.props.navigation.navigate('Approval', { data: this.state.selectedWarehouse })
}
}
......
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