Commit 4b207ce0 authored by Deni Rinaldi's avatar Deni Rinaldi

binding warehouse + list clar

parent 943d3f1d
This diff is collapsed.
...@@ -2,6 +2,7 @@ import React, { Component } from 'react' ...@@ -2,6 +2,7 @@ import React, { Component } from 'react'
import { Text, View, ScrollView, TouchableOpacity } from 'react-native' import { Text, View, ScrollView, TouchableOpacity } from 'react-native'
import { Container, Fab, Icon } from 'native-base' import { Container, Fab, Icon } from 'native-base'
import Next from 'react-native-vector-icons/MaterialIcons' import Next from 'react-native-vector-icons/MaterialIcons'
import api from '../../../service/api'
export default class Penerimaan extends Component { export default class Penerimaan extends Component {
...@@ -14,6 +15,20 @@ export default class Penerimaan extends Component { ...@@ -14,6 +15,20 @@ export default class Penerimaan extends Component {
] ]
} }
} }
componentDidMount() {
this.getListData()
// alert(JSON.stringify(this.props))
}
getListData() {
api.create().getListClar({
warehouse_id: Number(this.props.navigation.state.params.data)
}).then((response) => {
alert(JSON.stringify(response.data.data))
})
}
render() { render() {
return ( return (
<Container style={{ flex: 1 }}> <Container style={{ flex: 1 }}>
...@@ -71,8 +86,8 @@ export default class Penerimaan extends Component { ...@@ -71,8 +86,8 @@ export default class Penerimaan extends Component {
containerStyle={{}} containerStyle={{}}
style={{ backgroundColor: '#e4b300' }} style={{ backgroundColor: '#e4b300' }}
position="bottomRight" position="bottomRight"
onPress={() => this.props.navigation.navigate('MenuPenerimaan')} onPress={() => this.props.navigation.navigate('MenuPenerimaan')}
> >
<Icon name="add" /> <Icon name="add" />
</Fab> </Fab>
</Container> </Container>
......
const Constant = { const Constant = {
BASE_URL : 'https://103.44.149.207:8080/projectmanagement/public/mobile/', BASE_URL : 'http://103.44.149.207:8080/projectmanagement_dev/public/mobile/',
//USER //USER
TOKEN: 'TOKEN', TOKEN: 'TOKEN',
......
...@@ -24,7 +24,7 @@ const create = () => { ...@@ -24,7 +24,7 @@ const create = () => {
// alert(url) // alert(url)
// api.setBaseURL(`${url}/api/`) // api.setBaseURL(`${url}/api/`)
} else { } else {
token = "" token = "05ddbcb9f17bc952ed1c66fa2664e63710ed869a5bbb5079dcfec4424b9057a240b758b8b45fb7f617ffba0a966ebc2dd0e392491112ec8c64a2f311492dd0f0"
// url = Constant.BASE_URL.MASTER + '/api/' // url = Constant.BASE_URL.MASTER + '/api/'
// alert(url) // alert(url)
// api.setBaseURL(`${url}/api/`) // api.setBaseURL(`${url}/api/`)
...@@ -43,9 +43,14 @@ const create = () => { ...@@ -43,9 +43,14 @@ const create = () => {
const methodPost = (value) => POST('something', value) const methodPost = (value) => POST('something', value)
const login = (value) => POST('auth/login', value) const login = (value) => POST('auth/login', value)
const getListClar = (value) => api.post('demo/get_list_clar', value)
const getWarehouse = () => GET('demo/get_user_warehouse')
return { return {
login login,
getListClar,
getWarehouse
} }
} }
......
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